The nginx.conf configuration file is as follows user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } 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_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; # The attributes starting with ssl in the following attributes are related to certificate configuration. Please configure other attributes according to your needs. server { listen 443 ssl; #The SSL protocol access port number is 443. If SSL is not added here, Nginx may fail to start. server_name localhost; #Change localhost to the domain name bound to your certificate, for example: www.example.com. root html; index index.html index.htm; ssl_certificate /etc/nginx/huashengshu.top.pem; #Replace with the file name of your certificate. ssl_certificate_key /etc/nginx/huashengshu.top.key; #Replace with the key file name of your certificate. ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #Use this encryption suite. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #Use this protocol for configuration. ssl_prefer_server_ciphers on; location / { root /etc/nginx/hss; #Site directory. index index.html index.htm; } } server { listen 80; server_name huashengshu.top; rewrite ^(.*)$ https://${server_name}$1 permanent; } } What works is server { listen 80; server_name huashengshu.top; rewrite ^(.*)$ https://${server_name}$1 permanent; } This is the end of this article about how to use nginx proxy port 80 to port 443. For more information about how to use nginx proxy port 80 to port 443, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: js canvas implements verification code and obtains verification code function
>>: MySQL8 Installer version graphic tutorial
Nginx logs can be used to analyze user address lo...
Example: We use the Python code loop_hello.py as ...
Slow log query function The main function of slow...
1|0 Compile the kernel (1) Run the uname -r comma...
Table of contents 1. Find the mirror 2. Download ...
Table of contents 1. Decoupled assignment of arra...
Declare the parameter name, type and permission y...
Table of contents 1. What is a directive? Some co...
Table of contents Install Redis on Docker 1. Find...
Exporting Data Report an error SHOW VARIABLES LIK...
Table of contents Problem description: Cause Anal...
On Saturday, the redis server on the production s...
The pitfalls 1. Many tutorials on the Internet wr...
Since Zabbix version 3.0, it has supported encryp...
There are many database management tools for MySQ...