-
-
Save marcoroest87/9027d5759c2a7f0323bf to your computer and use it in GitHub Desktop.
This file contains 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 demo.hypershop.nl; | |
root /var/www/demo.hypershop.nl/html; | |
access_log /var/www/demo.hypershop.nl/logs/access_backend.log; | |
error_log /var/www/demo.hypershop.nl/logs/error_backend.log; | |
# i have removed this line now, but in the earlier gists this was not commented out (tried both ways, made no difference) | |
#pagespeed off; | |
index index.php; | |
port_in_redirect off; | |
location ~ /\. { return 404; } | |
location ~ ^/(app|includes|media/downloadable|lib|pkginfo|downloader|report/config.xml|var)/ { internal; } | |
location /var/export/ { internal; } | |
location /. { return 404; } | |
if ($request_method !~ ^(GET|HEAD|POST)$ ) { | |
return 444; | |
} | |
location / { | |
index index.php index.html; | |
try_files $uri $uri/ @handler; | |
expires 30d; | |
} | |
location ~* \.(jpe?g|gif|css|svg|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$ { | |
expires max; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
log_not_found off; | |
} | |
rewrite ^([^.\?]*[^/])$ $1/ permanent; | |
location @handler { rewrite / /index.php; } | |
location ~* .php/ { rewrite ^(.*.php)/ $1 last; } | |
location ~* .php$ { | |
fastcgi_param HTTPS on; | |
if (!-e $request_filename) { rewrite / /index.php last; } | |
fastcgi_read_timeout 300s; | |
fastcgi_keep_conn on; | |
fastcgi_pass unix:/var/run/hhvm/hhvm.sock; | |
fastcgi_index index.php; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param GEOIP_ADDR $remote_addr; | |
fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code; | |
include fastcgi_params; | |
fastcgi_param SERVER_PORT 80; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment