13,228
回編集
| 211行目: | 211行目: | ||
# ...略 | # ...略 | ||
} | |||
</syntaxhighlight> | |||
<br> | |||
==== NginXの設定 ==== | |||
NginXの設定ファイル(nginx.conf)において、<code>http</code>ディレクティブに、上記の設定が記述されているか確認する。<br> | |||
vi nginx.conf | |||
<br> | |||
<syntaxhighlight lang="nginx"> | |||
# nginx.confファイル | |||
http { | |||
# ...略 | |||
passenger_root /<NginX向けPassangerのインストールディレクトリ>/passenger-6.0.17; | |||
passenger_ruby /<Rubyのインストールディレクトリ>/bin/ruby-3_0; | |||
# ...略 | |||
} | |||
</syntaxhighlight> | |||
<br> | |||
==== 仮想ホストの構築 ==== | |||
NginXの設定ファイル(nginx.conf)において、<code>http</code>ディレクティブに、以下に示す設定を記述する。<br> | |||
vi nginx.conf | |||
<br> | |||
<syntaxhighlight lang="nginx"> | |||
# nginx.confファイル | |||
http { | |||
# ...略 | |||
include /<NginXのインストールディレクトリ>/etc/conf.d/*.conf; | |||
include /<NginXのインストールディレクトリ>/etc/vhosts.d/*.conf; | |||
# ...略 | |||
} | |||
</syntaxhighlight> | |||
<br> | |||
<syntaxhighlight lang="nginx"> | |||
# /<NginXのインストールディレクトリ>/etc/vhosts.d/redmine.confファイル | |||
# Ruby Application server Unicorn | |||
upstream redmine { | |||
server unix:/<Redmineのインストールディレクトリ>/tmp/sockets/unicorn.sock; | |||
} | |||
server { | |||
listen 80; | |||
server_name redmine; | |||
root /<Redmineのインストールディレクトリ>/public; | |||
passenger_enabled on; | |||
client_max_body_size 10m; # Max attachemnt size | |||
# for redmine + unicorn | |||
location / { | |||
alias /<Redmineのインストールディレクトリ>/public; | |||
try_files $uri/index.html $uri.html $uri @redmine; | |||
} | |||
location @redmine { | |||
proxy_redirect off; | |||
proxy_set_header X-Real-IP $remote_addr; | |||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
proxy_set_header Host $http_host; | |||
proxy_connect_timeout 60; | |||
proxy_read_timeout 60; | |||
proxy_send_timeout 600; | |||
proxy_pass http://redmine; | |||
} | |||
# redirect server error pages to the static page /50x.html | |||
error_page 500 502 503 504 /50x.html; | |||
location = /50x.html { | |||
root html; | |||
} | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||