Skip to content

Instantly share code, notes, and snippets.

@hawkapparel
Created July 2, 2020 01:50
Show Gist options
  • Save hawkapparel/4f0eb7e581664596a09258600a0de9f4 to your computer and use it in GitHub Desktop.
Save hawkapparel/4f0eb7e581664596a09258600a0de9f4 to your computer and use it in GitHub Desktop.
Configuratión for virtual host nginx with proxy for yourdomain.com
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
server_name yourdomain.com www.yourdomain.com; # setup your domain here
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
gzip_min_length 1000;
charset utf-8;
root /var/www/your-project/.nuxt/dist;
location / {
expires $expires;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://127.0.0.1:3000; # set the address of the Node.js instance here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment