diff options
Diffstat (limited to 'nginx.conf')
-rw-r--r-- | nginx.conf | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 000000000000..b5be47ba361c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,66 @@ +# pimpmylog.conf +# nginx config include for a local virtual host for PimpMyLog + +# Copyright 2014 James An + +# THIS PROGRAM is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +server { + access_log /var/log/nginx/pimpmylog.access.log; + error_log /var/log/nginx/pimpmylog.error.log; + + include fastcgi_params; + fastcgi_param MAIN_SITE_NAME pimpmylog.lacolhost.com; + set $main_site_name "pimpmylog.lacolhost.com"; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + listen *:80; + server_name pimpmylog.lacolhost.com; + root /usr/share/webapps/pimpmylog; + + location ~* \.php$ { + add_header X-Speed-Cache "$upstream_cache_status"; + add_header X-Speed-Cache-UID "$cache_uid"; + add_header X-Speed-Cache-Key "$key_uri"; + add_header X-NoCache "$nocache_details"; + add_header X-This-Proto "$http_x_forwarded_proto"; + add_header X-Server-Name "$main_site_name"; + add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; + tcp_nopush off; + keepalive_requests 0; + try_files $uri =404; ### check for existence of php file first + fastcgi_pass 127.0.0.1:9000; + ### + ### Use Nginx cache for all visitors. + ### + set $nocache ""; + if ( $nocache_details ~ (?:AegirCookie|Args|Skip) ) { + set $nocache "NoCache"; + } + fastcgi_cache speed; + fastcgi_cache_methods GET HEAD; ### Nginx default, but added for clarity + fastcgi_cache_min_uses 1; + fastcgi_cache_key "$is_bot$device$host$request_method$key_uri$cache_uid$http_x_forwarded_proto$sent_http_x_local_proto$cookie_respimg"; + fastcgi_cache_valid 200 10s; + fastcgi_cache_valid 302 1m; + fastcgi_cache_valid 301 403 404 5s; + fastcgi_cache_valid 500 502 503 504 1s; + fastcgi_ignore_headers Cache-Control Expires; + fastcgi_pass_header Set-Cookie; + fastcgi_pass_header X-Accel-Expires; + fastcgi_pass_header X-Accel-Redirect; + fastcgi_no_cache $cookie_NoCacheID $http_authorization $http_pragma $nocache; + fastcgi_cache_bypass $cookie_NoCacheID $http_authorization $http_pragma $nocache; + fastcgi_cache_use_stale error http_500 http_503 invalid_header timeout updating; + } +} |