Last active
July 5, 2018 18:56
-
-
Save Chekote/2604f7138c53bc2898d05cefa164616d to your computer and use it in GitHub Desktop.
nginx config for remote 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 { | |
listen 80; | |
server_name WEBSERVER_HOSTNAME_GOES_HERE; | |
root /var/www/public; | |
index index.html index.php; | |
access_log syslog:server=unix:/dev/log; | |
error_log syslog:server=unix:/dev/log; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+?\.php)(/.*)$; | |
if (!-f $document_root$fastcgi_script_name) { | |
return 404; | |
} | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
fastcgi_pass PHP_FPM_HOSTNAME_GOES_HERE:9000; | |
fastcgi_index index.php; | |
} | |
# set client body size to 2M # | |
client_max_body_size 2M; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment