|
####################################################################### |
|
# |
|
# This is the main Nginx configuration file. |
|
# |
|
# More information about the configuration options is available on |
|
# * the English wiki - http://wiki.nginx.org/Main |
|
# * the Russian documentation - http://sysoev.ru/nginx/ |
|
# |
|
####################################################################### |
|
|
|
#---------------------------------------------------------------------- |
|
# Main Module - directives that cover basic functionality |
|
# |
|
# http://wiki.nginx.org/NginxHttpMainModule |
|
# |
|
#---------------------------------------------------------------------- |
|
|
|
user nginx; |
|
worker_processes 3; |
|
|
|
error_log /var/log/nginx/error.log; |
|
#error_log /var/log/nginx/error.log notice; |
|
#error_log /var/log/nginx/error.log info; |
|
|
|
pid /var/run/nginx.pid; |
|
|
|
|
|
#---------------------------------------------------------------------- |
|
# Events Module |
|
# |
|
# http://wiki.nginx.org/NginxHttpEventsModule |
|
# |
|
#---------------------------------------------------------------------- |
|
|
|
events { |
|
worker_connections 1024; |
|
} |
|
|
|
|
|
#---------------------------------------------------------------------- |
|
# HTTP Core Module |
|
# |
|
# http://wiki.nginx.org/NginxHttpCoreModule |
|
# |
|
#---------------------------------------------------------------------- |
|
|
|
http { |
|
|
|
upstream charag{ |
|
server 127.0.0.1:5000; |
|
} |
|
|
|
upstream redmine{ |
|
server 127.0.0.1:5001; |
|
} |
|
|
|
server { |
|
listen 80; |
|
server_name test.charag.jp; |
|
|
|
access_log /var/log/nginx_access.log; |
|
error_log /var/log/nginx_error.log; |
|
|
|
proxy_connect_timeout 60; |
|
proxy_read_timeout 60; |
|
proxy_send_timeout 60; |
|
|
|
location / { |
|
|
|
root /home/www/rails/charag/public; |
|
if (-f $request_filename){ |
|
break; |
|
} |
|
|
|
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_pass http://charag; |
|
proxy_redirect off; |
|
} |
|
} |
|
|
|
server { |
|
listen 80; |
|
server_name redmine.charag.jp; |
|
|
|
access_log /var/log/nginx_redmine_access.log; |
|
error_log /var/log/nginx_redmine_error.log; |
|
|
|
proxy_connect_timeout 60; |
|
proxy_read_timeout 60; |
|
proxy_send_timeout 60; |
|
|
|
auth_basic "Secret Area"; |
|
auth_basic_user_file "/home/www/rails/redmine/.htpasswd"; |
|
|
|
location / { |
|
|
|
root /home/www/rails/redmine/public; |
|
if (-f $request_filename){ |
|
break; |
|
} |
|
|
|
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_pass http://redmine; |
|
proxy_redirect off; |
|
} |
|
} |
|
} |
This comment has been minimized.
awesome!!! thank you very much :)