Created
November 29, 2017 18:29
-
-
Save ozzpy/c74c468cc18e1af2c95a9d83bb39cd64 to your computer and use it in GitHub Desktop.
nginx-add-host
This file contains 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
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