Re-optimize default vhost config.

This commit is contained in:
joglomedia
2019-12-25 20:27:10 +07:00
parent 4146183b71
commit 246d1702fb

View File

@@ -1,46 +1,29 @@
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Generated by LEMPer.sh
server {
listen 80 default_server;
listen [::]:80 default_server;
# Make site accessible from http://localhost.localdomain/
server_name localhost.localdomain;
#include /etc/nginx/includes/ssl.conf;
#ssl_certificate /etc/letsencrypt/live/localhost.localdomain/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/localhost.localdomain/privkey.pem;
#ssl_trusted_certificate /etc/letsencrypt/live/localhost.localdomain/fullchain.pem;
access_log /var/log/nginx/localhost.access.log;
error_log /var/log/nginx/localhost.error.log;
root /usr/share/nginx/html;
index index.php index.html index.htm;
# Log Settings.
access_log /var/log/nginx/localhost.access.log;
error_log /var/log/nginx/localhost.error.log;
include /etc/nginx/includes/rules_security.conf;
include /etc/nginx/includes/rules_staticfiles.conf;
include /etc/nginx/includes/rules_restriction.conf;
#include /etc/nginx/includes/rules_fastcgi_cache.conf;
# Error page directives.
include /etc/nginx/includes/error_pages.conf;
include /etc/nginx/vhost/site_default.conf;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
#include /etc/nginx/naxsi.rules;
# Uncomment to enable auto index
autoindex off;
}
# PHP-FPM status monitoring
location ~ ^/(status|ping)$ {
include /etc/nginx/fastcgi_params;
@@ -52,8 +35,6 @@ server {
auth_basic_user_file /srv/.htpasswd;
}
# Pass the PHP scripts to FastCGI server listening on Unix socket.
#
location ~ \.(php|php73)$ {
try_files $uri =404;
@@ -119,17 +100,9 @@ server {
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
}
# Deny access to lcp directory.
location ~ ^/lcp {
deny all;
}
include /etc/nginx/includes/error_pages.conf;
# Deny access to .htaccess files, if Apache's document root
# concurs with Nginx's one
#
location ~ /\.ht {
deny all;
}
#include /etc/nginx/includes/fcgiwrap.conf;
}
## LEMPer Web-based Administration
@@ -137,7 +110,6 @@ server {
listen 8082;
listen [::]:8082;
# Make site accessible from http://localhost.localdomain:8082/
server_name localhost.localdomain;
root /usr/share/nginx/html;
@@ -248,34 +220,9 @@ server {
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
}
# Deny access to .htaccess files, if Apache's document root
# concurs with Nginx's one
#
location ~ /\.ht {
deny all;
}
include /etc/nginx/includes/error_pages.conf;
#include /etc/nginx/includes/fcgiwrap.conf;
}
# HTTPS server
#
#server {
# listen 443 ssl http2;
# server_name localhost;
#
# root html;
# index index.html index.htm;
#
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
#
# ssl_session_timeout 5m;
#
# ssl_protocols SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
# ssl_prefer_server_ciphers on;
#
# location / {
# try_files $uri $uri/ /index.html;
# }
#}
## SSL redirection here.