# safe to ignore, if you don't understand what it is doing! server { listen 80; # please replace 127.0.0.1 with the actual IP of the server server_name 127.0.0.1; root /var/www/html; ### logs # enable only one of the following access_log off; # access_log /var/log/nginx/ip-access.log; # simple log # access_log /var/log/nginx/ip-access.log combined buffer=64k flush=5m if=$loggable; # log only non-2xx and non-3xx requests; $loggable is defined in conf.d/common.conf # enable only one of the following error_log off; # error_log /var/log/nginx/ip-error.log; # error_log /var/log/nginx/ip-error.log debug; # depends on server support ### PhpMyAdmin # note: it's a bad idea to serve PhpMyAdmin via the server's IP as it is the known target by bad bots # keeping it here for historical reasons # location /phpmyadmin { # include whitelist.conf; # try_files $uri $uri/ /phpmyadmin/index.php$is_args$args; # location ~* \.php$ { # try_files $uri = 404; # fastcgi_split_path_info ^(.+\.php)(/.+)$; # include fastcgi.conf; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_index index.php; # fastcgi_pass fpm; # } # } # Nginx status location = /nginxstatus { stub_status on; access_log off; include whitelist.conf; expires -1; } # PHP-FPM ping location = /ping { fastcgi_pass fpm; include fastcgi_params; include whitelist.conf; expires -1; } # PHP-FPM status location = /status { fastcgi_pass fpm; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include whitelist.conf; expires -1; } location /munin { alias "/var/cache/munin/www"; try_files $uri $uri/ /index.html; include whitelist.conf; expires -1; } location /monit/ { rewrite ^/monit/(.*) /$1 break; proxy_pass http://127.0.0.1:2812; # replace 127.0.0.2 with the IP of the server # proxy_redirect http://127.0.0.1:2812/monit/ http://127.0.0.2/monit/; include whitelist.conf; expires -1; } # Redirect to the main site domainname.com location / { return $scheme://example.com$request_uri; } }