Created
November 28, 2018 11:03
-
-
Save iCaspar/457a2285ca1890e5ba23c7c69fa113e2 to your computer and use it in GitHub Desktop.
A default nginx config for php apps.
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 default_server; | |
root /var/www/html; | |
index index.html index.htm index.php; | |
server_name localhost; | |
charset utf-8; | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
log_not_found off; | |
access_log off; | |
} | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
try_files $fastcgi_script_name =404; | |
set $path_info $fastcgi_path_info; | |
fastcgi_param PATH_INFO $path_info; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_pass php:9000; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
error_page 404 /index.html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment