### 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.# https://www.nginx.com/resources/wiki/start/# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/# https://wiki.debian.org/Nginx/DirectoryStructure## In most cases, administrators will remove this file from sites-enabled/ and# leave it as reference inside of sites-available where it will continue to be# updated by the nginx packaging team.## This file will automatically load configuration files provided by other# applications, such as Drupal or Wordpress. These applications will be made# available underneath a path with that package name, such as /drupal8.## Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.### Default server configuration##server { listen 80;#listen [::]:80 default_server;# SSL configuration## listen 443 ssl default_server;# listen [::]:443 ssl default_server;## Note: You should disable gzip for SSL traffic.# See: https://bugs.debian.org/773332## Read up on ssl_ciphers to ensure a secure configuration.# See: https://bugs.debian.org/765782## Self signed certs generated by the ssl-cert package# Don't use them in a production server!## include snippets/snakeoil.conf; root /home/xxx/my_blog/public\\;# Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name skfwe.cn;#rewrite ^(.*)$ https://$host$1 permanent;# location / {# # First attempt to serve request as file, then# # as directory, then fall back to displaying a 404.# try_files $uri $uri/ =404;# }return301 https://$host$request_uri;}server {#监听443端口 listen 443 ssl;# nginx version > 1.15.0#listen 443 default;#ssl on;#你的域名 server_name skfwe.cn;#ssl证书的pem文件路径 ssl_certificate /home/xxx/skfwe.cn_nginx/skfwe.cn_bundle.crt;#ssl证书的key文件路径 ssl_certificate_key /home/xxx/skfwe.cn_nginx/skfwe.cn.key; ssl_session_timeout 5m;#请按照以下协议配置 ssl_protocols TLSv1.2 TLSv1.3;#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; location / { root /home/xxx/my_blog/public\\;# Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html;}}# Virtual Host configuration for example.com## You can move that to a different file under sites-available/ and symlink that# to sites-enabled/ to enable it.##server {# listen 80;# listen [::]:80;## server_name example.com;## root /var/www/example.com;# index index.html;## location / {# try_files $uri $uri/ =404;# }#}