-
-
Save mikej/e8a95eac05238c6a4adb18378968321e to your computer and use it in GitHub Desktop.
nginx config with SSL
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
upstream app { | |
# Path to Puma SOCK file, as defined previously | |
server unix:/home/deploy/demoapp/shared/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name demoapp.josephson.org; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
# SSL configuration | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
include snippets/ssl-demoapp.josephson.org.conf; | |
include snippets/ssl-params.conf; | |
server_name demoapp.josephson.org; | |
root /home/deploy/demoapp/public; | |
try_files $uri/index.html $uri @app; | |
location @app { | |
proxy_pass http://app; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_redirect off; | |
} | |
error_page 500 502 503 504 /500.html; | |
client_max_body_size 4G; | |
keepalive_timeout 10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment