When I tried to configure the SSL server on Nginx, I got a title error.
Below are nginx.conf and default.conf.
nginx.conf
usernginx;
worker_processes auto;
error_log/var/log/nginx/error.log warn;
pid/var/run/nginx.pid;
events {
worker_connections1024;
}
US>http{
include/etc/nginx/mime.types;
default_type application/octet-stream;
log_format main'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_refer"'
'''$http_user_agent''''$http_x_forwarded_for";
access_log/var/log/nginx/access.log main;
sendfile on;
# tcp_nopush on;
keepalive_timeout65;
gzip on;
include/etc/nginx/conf.d/*.conf;
server_tokens off;
}
default.conf
server{
listen80;
listen [::]:80;
return301 https://$host$request_uri;
}
server{
listen443 ssl http2;
listen [::]:443 ssl http2;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
server_name domain;
ssl_certificate/etc/letsencrypt/live/domain/fullchain.pem;
ssl_certificate_key/etc/letsencrypt/live/domain/privkey.pem;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE+RSAGCM:ECDH+AESGCM:DH+AES256:DH+AES256:DH+AES256:DH+AES128:DH+AES:!aNULL!eNull:!EXPORT:!DES:!3DES:!MD5:!DSS;
ssl_dhparam/etc/nginx/ssl/dhparam.pem;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains;';
client_max_body_size64M;
# Enable OCSP Stapling
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate/etc/letsencrypt/live/domain/fullchain.pem;
# DNS resolver must be specified for OCSP Stapling
resolver 8.8.8.8;
# Deny access to any files with a.php extension in the uploads directory
location~*/(?:uploads|files)/.*\.php${
deny all;
}
location / {
proxy_pass http://127.0.0.1:port;
}
location^~/.well-known/acme-challenge/{
root/usr/share/nginx/html;
}
location~.*\.(jpg|JPG|gif|GIF|png|PNG|swf|SWF|css|CSS|js|inc|INC|ico|ICO){
root route;
}
}
This error did not occur when SSL was not used.Why did I get this error?
nginx
default.conf is included in http{} in nginx.conf, but
Have you included it elsewhere?
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
581 PHP ssh2_scp_send fails to send files as intended
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.