Skip to content

Instantly share code, notes, and snippets.

@Tatsh
Last active July 13, 2020 22:26
Show Gist options
  • Save Tatsh/2565517 to your computer and use it in GitHub Desktop.
Save Tatsh/2565517 to your computer and use it in GitHub Desktop.
nginx configuration for mirroring PHP.net
server {
server_name php.sutralib.com;
access_log /var/log/nginx/php.sutralib.com.access_log main;
error_log /var/log/nginx/php.sutralib.com.error_log info;
root /home/tatsh/dev/php-doc;
index index.php;
error_page 401 /error.php;
error_page 403 /error.php;
error_page 404 /error.php;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
add_header Vary "Accept-Encoding";
expires max;
tcp_nodelay off;
tcp_nopush on;
}
location = /robots.txt {
deny all;
log_not_found off;
access_log off;
}
location ~* \.(git|svn|patch|htaccess|log|inc|json|pl|po|sh|ini|sql) {
deny all;
}
location ~ \.php$ {
fastcgi_param MIRROR_LANGUAGE "en";
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment