Created
February 23, 2020 19:48
-
-
Save swilgosz/28cee136707842b0d6af8c26f07e3838 to your computer and use it in GitHub Desktop.
Try to configure: /* => JS UI and /api/* => to Rails API.
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 { | |
server_name sourcerio.com www.sourcerio.com; | |
listen 80; | |
listen 443 ssl http2; | |
include letsencrypt.conf; | |
client_max_body_size 10M; | |
keepalive_timeout 10; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_pass_header Set-Cookie; | |
ssl_certificate_key /etc/nginx/certs/live/sourcerio.com/privkey.pem; | |
ssl_certificate /etc/nginx/certs/live/sourcerio.com/fullchain.pem; | |
location /api { | |
if ($scheme != "https") { | |
rewrite ^ https://$host$uri permanent; | |
} | |
proxy_pass http://api:3000; | |
} | |
location / { | |
if ($scheme != "https") { | |
rewrite ^ https://$host$uri permanent; | |
} | |
proxy_pass http://ui:80; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment