Skip to content

Instantly share code, notes, and snippets.

@dphilla
Last active December 18, 2020 19:29
Show Gist options
  • Save dphilla/1a9f31925aa5614babe0d9b22c830362 to your computer and use it in GitHub Desktop.
Save dphilla/1a9f31925aa5614babe0d9b22c830362 to your computer and use it in GitHub Desktop.
basic_ngnix_server
# from mina production
# Ubuntu 20.04
# /etc/nginx/sites-available/mina symlinked to /etc/nginx/sites-enabled/mina
# todo: more needed here for redirects, static pages, etc**
upstream mina {
server unix:///home/mina/app/shared/tmp/sockets/puma.sock;
}
server {
listen 80;
root /home/mina/app/current/public;
location ~ ^/(assets)/ {
gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
}
location / {
try_files $uri @app;
}
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://mina;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment