Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- # listen directive here.
- include /etc/nginx/port.conf;
- server_name example.com;
- root /home/path/to/example.com/app/webroot/;
- index index.php;
- try_files $uri $uri/ index.php;
- if (-f $request_filename) {
- break;
- }
- if (!-f $request_filename) {
- rewrite ^/(.+)$ /index.php?url=$1 last;
- break;
- }
- location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
- expires 1y;
- log_not_found off;
- }
- location / {
- try_files $uri $uri/ /index.php?$uri&$args;
- # autoindex on;
- types {
- text/html html htm shtml;
- text/css css;
- text/xml xml;
- image/gif gif;
- image/jpeg jpeg jpg;
- }
- default_type application/octet-stream;
- }
- location ~ \.php$ {
- try_files $uri =404;
- include /etc/nginx/fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_read_timeout 30;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement