Hi Rich. When it’s a directory, the configuration check fails.
Hi,andyj
my nginx.conf:
user tc staff;
worker_processes 1;
error_log /tmp/nginx_error.log warn;
pid /tmp/nginx.pid;
events {
worker_connections 512;
}
http {
include mime.types;
default_type application/octet-stream;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_types
text/plain
text/css
text/javascript
application/json
application/javascript
application/xml+rss
image/svg+xml;
client_body_temp_path /tmp/nginx/client;
server_tokens off;
server {
listen 80;
listen [::]:80;
server_name xxxxx;
return 301 https://$host:xxx$request_uri ;
}
server {
listen xxx ssl;
listen [::]:xxx ssl;
http2 on;
server_name xxxxx;
root /xxxx/web;
index index.html;
charset utf-8;
autoindex off;
ssl_certificate /etc/xxxx/server-cert.pem;
ssl_certificate_key /etc/xxxx/server-key.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
add_header X-Content-Type-Options "nosniff";
add_header Referrer-Policy "no-referrer-when-downgrade" always;
if ($request_method !~ ^(GET|HEAD|OPTIONS)$ ) {
return 405;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location ~* \.\. {
deny all;
return 403;
}
........
}
}