Last active
January 11, 2019 12:07
-
-
Save cbednarski/6504006 to your computer and use it in GitHub Desktop.
Nginx and php-fpm configs for local development
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 8080; | |
| server_name local.webblob.com; | |
| root /Users/cbednarski/code/WebBlob/src; | |
| error_page 403 /403.html; | |
| error_page 404 /404.html; | |
| error_page 500 /500.html; | |
| error_page 502 /502.html; | |
| error_page 503 /503.html; | |
| error_page 504 /504.html; | |
| location / { | |
| index index.html index.htm; | |
| try_files $uri /index.php; | |
| } | |
| # Handles generic .php files | |
| location ~ \.php$ { | |
| fastcgi_pass unix:/usr/local/var/php-fpm.sock; | |
| include fastcgi_params; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| fastcgi_intercept_errors on; | |
| } | |
| # Handles a front-controller | |
| location /index.php { | |
| fastcgi_pass unix:/usr/local/var/php-fpm.sock; | |
| include fastcgi_params; | |
| fastcgi_param SCRIPT_FILENAME $document_root/index.php; | |
| fastcgi_intercept_errors on; | |
| } | |
| location ~ /([0-9][0-9][0-9]).html { | |
| try_files $1.html @error; | |
| internal; | |
| } | |
| location @error { | |
| # see: https://github.com/cbednarski/slick-error-pages | |
| root /Users/cbednarski/code/slick-error-pages; | |
| } | |
| } |
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
| [global] | |
| pid = /usr/local/var/run/php-fpm.pid | |
| error_log = /usr/local/var/log/php/5.4/php_fpm.error.log | |
| daemonize = no | |
| emergency_restart_threshold = 10 | |
| emergency_restart_interval = 1m | |
| process_control_timeout = 10s | |
| [www] | |
| listen = /usr/local/var/php-fpm.sock | |
| listen.allowed_clients = 127.0.0.1 | |
| pm = dynamic | |
| pm.status_path = /fpm_status | |
| pm.max_children = 256 | |
| pm.start_servers = 25 | |
| pm.min_spare_servers = 5 | |
| pm.max_spare_servers = 50 | |
| pm.max_requests = 4000 | |
| slowlog = /usr/local/var/log/php/5.4/php_fpm.slow.log | |
| request_slowlog_timeout = 10 | |
| request_terminate_timeout = 60 | |
| catch_workers_output = yes | |
| php_value[date.timezone] = America/Los_Angeles | |
| php_value[error_reporting] = E_ALL & ~E_STRICT |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, it occurs to me that the
php_valueconfigs should be set inphp.ini, not in the fpm configuration.