Skip to content

Instantly share code, notes, and snippets.

@aslamdoctor
Last active December 29, 2019 03:18
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 aslamdoctor/682fa2d8a589615a0df583623d57c830 to your computer and use it in GitHub Desktop.
Save aslamdoctor/682fa2d8a589615a0df583623d57c830 to your computer and use it in GitHub Desktop.
nginx configurations for Nuxt + WordPress
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
listen 80;
listen [::]:80;
# enable if forcing to https
#if ($scheme = http) {
# return 301 https://$server_name$request_uri;
#}
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com;
# Nuxt Project
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
}
# Wordpress Project
location /wordpress/ {
try_files $uri $uri/ /wordpress/index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment