Created
October 14, 2022 17:54
-
-
Save laruiss/f221501d9cde8ed10c67ff56ea6ba2fd to your computer and use it in GitHub Desktop.
Scalingo Nginx config
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
# Static files directory | |
root <%= ENV['STATIC_DIR'] || '/usr/share/nginx/html' %>; | |
index index.html; | |
location / { | |
try_files $uri $uri/ /index.html =404; | |
} | |
location /api { | |
rewrite "^(.*)$" $1 break; | |
add_header Access-Control-Allow-Origin '$http_origin'; | |
# proxy_pass http://jsdl-api:4000; | |
proxy_pass http://<%= ENV['API_HOST'] || 'jsdl-api' %>:<%= ENV['API_PORT'] || '4000' %>; | |
proxy_redirect off; | |
proxy_buffering off; | |
proxy_http_version 1.1; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
# For WebSockets | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment