Created
June 8, 2013 16:05
-
-
Save pacojp/5735624 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream example.com.backend { | |
server 127.0.0.1:3000; | |
} | |
# redirect with | |
server { | |
listen 80; | |
server_name example.com *.example.com; | |
rewrite ^ http://www.example.com$request_uri? permanent; | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
rewrite_log on; | |
charset utf-8; | |
access_log /var/log/nginx/example.com/access.log; | |
error_log /var/log/nginx/example.com/error.log; | |
location / { | |
proxy_pass http://example.com.backend; | |
proxy_redirect default; | |
} | |
} | |
# server { | |
# listen 443; | |
# server_name example.com; | |
# ssl on; | |
# ssl_certificate /etc/nginx/ssl/example.com.crt; | |
# ssl_certificate_key /etc/nginx/nginx/example.com.key; | |
# | |
# ssl_session_timeout 5m; | |
# ssl_protocols SSLv2 SSLv3 TLSv1; | |
# ssl_ciphers HIGH:!aNULL:!MD5; | |
# ssl_prefer_server_ciphers on; | |
# | |
# rewrite_log on; | |
# | |
# charset utf-8; | |
# access_log /var/log/nginx/example.com/access.log; | |
# error_log /var/log/nginx/example.com/error.log; | |
# | |
# location / { | |
# proxy_redirect off; | |
# proxy_set_header Host $host; | |
# proxy_set_header X-Real-IP $remote_addr; | |
# proxy_set_header X-Forwarded-Proto https; | |
# proxy_set_header X-Forwarded-Host $host; | |
# proxy_set_header X-Forwarded-Server $host; | |
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# proxy_pass http://example.com.backend; | |
# break; | |
# } | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment