Created
September 26, 2011 23:11
-
-
Save jacobian/1243704 to your computer and use it in GitHub Desktop.
This file contains 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
# Nginx conf (/etc/nginx/nginx.conf). | |
user www-data; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
worker_processes 4; | |
events { | |
worker_connections 100; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
server_tokens off; | |
server { | |
listen 80; | |
listen 443; | |
server_name .jacobian.org; | |
# Redirect http to https | |
if ($scheme = "http") { | |
rewrite ^ https://$host$request_uri? permanent; | |
} | |
location /media { | |
alias /home/web/jacobian.org/jacobian/media; | |
} | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Protocol SSL; | |
proxy_pass http://127.0.0.1:8000; | |
} | |
} | |
# fallback for unknown names | |
server { | |
listen 80 default; | |
server_name _; | |
return 444; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment