Last active
December 18, 2020 19:29
-
-
Save dphilla/1a9f31925aa5614babe0d9b22c830362 to your computer and use it in GitHub Desktop.
basic_ngnix_server
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
# 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