Created
February 27, 2012 15:09
-
-
Save chonthu/1924447 to your computer and use it in GitHub Desktop.
nginx sample config
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 .sandbox.com; | |
| root /var/www; | |
| # set expiration of assets to MAX for caching | |
| location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { | |
| expires max; | |
| log_not_found off; | |
| } | |
| location / { | |
| # Check if a file exists, or route it to index.php. | |
| try_files $uri $uri/ /index.php; | |
| } | |
| location ~* \.php$ { | |
| fastcgi_pass fastcgi_pass unix:/tmp/php.socket; | |
| fastcgi_index index.php; | |
| fastcgi_split_path_info ^(.+\.php)(.*)$; | |
| include fastcgi_params; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name | |
| } | |
| # deny any .php files | |
| location ~ \.php { | |
| internal; | |
| return 404; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment