Created
September 12, 2013 08:49
-
-
Save wgm89/6534631 to your computer and use it in GitHub Desktop.
codeigniter nginx rewrite
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 8089; ## listen for ipv4; this line is default and implied | |
| #listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
| root /var/www/; | |
| index index.php index.html index.htm; | |
| # Make site accessible from http://localhost/ | |
| server_name localhost; | |
| location / { | |
| index index.php; | |
| root /var/www/; | |
| if (!-e $request_filename) { | |
| rewrite ^/(.*)$ /index.php/$1 last; | |
| } | |
| } | |
| location /doc/ { | |
| alias /usr/share/doc/; | |
| autoindex on; | |
| allow 127.0.0.1; | |
| deny all; | |
| } | |
| location ~ /index.php/ { | |
| fastcgi_param SCRIPT_FILENAME /path/to/your/index.php; | |
| fastcgi_index index.php; | |
| fastcgi_pass 127.0.0.1:9000; | |
| include fastcgi_params; | |
| fastcgi_param PATH_INFO $fastcgi_script_name; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment