Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80; ## listen for ipv4; this line is default and implied
- #listen [::]:80 default ipv6only=on; ## listen for ipv6
- root /data-ebs/websites/site1/public_html;
- index index.php index.html index.htm;
- # Make site accessible from http://localhost/
- server_name www.site1.com;
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location / {
- # This is cool because no php is touched for static content.
- # include the "?$args" part so non-default permalinks doesn't break when using query string
- try_files $uri $uri/ /index.php?$args;
- #proxy_cache_valid any 1m;
- proxy_cache_valid 500 2s;
- expires 1m;
- }
- location /autos/ {
- #rewrite ^ https://www.crhoy.com$request_uri? permanent;
- try_files $uri $uri/ /autos/index.php?$args;
- }
- set $cache_uri $request_uri;
- location ~ \.php$ {
- ##
- # Fastcgi cache
- ##
- set $skip_cache 1;
- if ($cache_uri != "null cache") {
- add_header X-Cache-Debug "$cache_uri $cookie_nocache $arg_nocache$arg_comment $http_pragma $http_authorization";
- set $skip_cache 0;
- }
- fastcgi_cache_bypass $skip_cache;
- fastcgi_cache microcache;
- fastcgi_cache_key $scheme$host$request_uri$request_method;
- fastcgi_cache_valid any 8m;
- fastcgi_cache_bypass $http_pragma;
- fastcgi_cache_use_stale updating error timeout invalid_header http_500;
- fastcgi_read_timeout 150;
- try_files $uri =404;
- #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
- include fastcgi.conf;
- fastcgi_connect_timeout 60;
- fastcgi_intercept_errors on;
- fastcgi_pass php;
- }
- location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
- add_header Access-Control-Allow-Origin *;
- access_log off; log_not_found off; expires max;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement