Created
July 20, 2015 19:37
-
-
Save joepreludian/54180bdd0238b54f5f1b to your computer and use it in GitHub Desktop.
NGINX Template to handle php throught PHP-FPM over /var/run/sock/php.sock
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 myawesomesite.com www.myawesomesite.com; | |
| client_max_body_size 4G; | |
| root /home/mysite/public_html; | |
| access_log /home/mysite/logs/nginx-access.log; | |
| error_log /home/mysite/logs/nginx-error.log; | |
| index index.php; | |
| location / { | |
| try_files $uri $uri/ index.php; | |
| } | |
| location ~ \.php$ { | |
| try_files $uri =404; | |
| fastcgi_index index.php; | |
| fastcgi_pass unix:/var/run/sock/php.sock; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| fastcgi_read_timeout 600; | |
| include /etc/nginx/fastcgi_params; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will be needed to be used with PHP-FPM module. The scripts does the following: