Created
April 15, 2023 18:43
-
-
Save sytzez/9576a159c5c193fb8f19c68ec59b6a36 to your computer and use it in GitHub Desktop.
Hosting a Rails app through HTTPS using Nginx and Puma
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
server { | |
listen 443 ssl; | |
server_name myapp.com; | |
ssl_certificate /home/my_app/server.crt; | |
ssl_certificate_key /home/my_app/server.key; | |
location / { | |
proxy_set_header Host $http_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-Host $server_name; | |
proxy_set_header Client-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto https; | |
proxy_pass http://localhost:3000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment