Skip to content

Instantly share code, notes, and snippets.

@laruiss
Created October 14, 2022 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laruiss/f221501d9cde8ed10c67ff56ea6ba2fd to your computer and use it in GitHub Desktop.
Save laruiss/f221501d9cde8ed10c67ff56ea6ba2fd to your computer and use it in GitHub Desktop.
Scalingo Nginx config
# 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