-
-
Save janl/2a8e6ebc80a25817dca0 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
server { | |
listen *:80 default_server; | |
server_name yourapp.com; | |
access_log /var/log/nginx/yourapp.com.access_log proxy; | |
error_log /var/log/nginx/yourapp.com.error_log warn; | |
# force all over https | |
rewrite ^ https://yourapp.com$request_uri? permanent; | |
} | |
## main hoodie app | |
server { | |
listen *:443; | |
server_name yourapp.com; | |
access_log /var/log/nginx/yourapp.com.ssl_access_log proxy; | |
error_log /var/log/nginx/yourapp.com.ssl_error_log warn; | |
ssl on; | |
ssl_certificate /etc/ssl/yourapp.com/yourapp.com.chained.crt; | |
ssl_certificate_key /etc/ssl/yourapp.com/yourapp.com.key; | |
ssl_session_cache shared:SSL:16m; | |
ssl_session_timeout 10m; | |
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers RC4:HIGH:!aNULL:!MD5:!kEDH; | |
ssl_prefer_server_ciphers on; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
location / { | |
root /home/hoodie/yourapp/www; | |
error_page 404 = /; | |
} | |
location ~ ^/_api(.*) { | |
proxy_pass http://127.0.0.1:6001; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
location ~ ^/(.*)/_changes { | |
proxy_pass http://127.0.0.1:6001; | |
proxy_redirect off; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment