Created
October 1, 2014 22:37
-
-
Save InFog/42082e3c03543d7e05c7 to your computer and use it in GitHub Desktop.
Nginx basic example with rewrite and PHP-FPM
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
server { | |
server_name example; | |
root /var/www/example; | |
index index.php index.html index.htm; | |
# error_log /var/log/nginx/example.error_log debug; | |
rewrite_log on; | |
location ~* ^/(assets|css|fonts|img|js|upload) { } | |
location / { | |
try_files $uri $uri/ /index.php?/$request_uri; | |
} | |
# PHP-FPM | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME /var/www/vortexnet$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
# No access do htaccess | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment