Skip to content

Instantly share code, notes, and snippets.

@ozzpy
Created November 29, 2017 18:29
Show Gist options
  • Save ozzpy/c74c468cc18e1af2c95a9d83bb39cd64 to your computer and use it in GitHub Desktop.
Save ozzpy/c74c468cc18e1af2c95a9d83bb39cd64 to your computer and use it in GitHub Desktop.
nginx-add-host
server {
listen 80;
listen [::]:80;
root /home/${OZZPY_DOMAIN}/www/public;
index index.php index.html index.htm;
server_name ${OZZPY_DOMAIN} www.${OZZPY_DOMAIN};
location / {
try_files $uri $uri/ =404;
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php last;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php${OZZPY_PHP_VERSION}-fpm.sock;
}
access_log /home/${OZZPY_DOMAIN}/logs/access.log;
error_log /home/${OZZPY_DOMAIN}/logs/error.log;
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment