nginx.conf配置格式
生活随笔
收集整理的這篇文章主要介紹了
nginx.conf配置格式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
80端口:
server{listen 80;#listen [::]:80;server_name 域名 ;index index.html index.htm index.php default.html default.htm default.php;root /home/wwwroot/aaa;include none.conf;#error_page 404 /404.html;# Deny access to PHP files in specific directory#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }include enable-php.conf;location / {if ( !-e $request_filename ) {rewrite ^(.*)$ /index.php?s=/$1 last;break;}}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 12h;}location ~ /.well-known {allow all;}location ~ /\.{deny all;}access_log /home/wwwlogs/日志.log;}1111:端口
server{listen 1111;#listen [::]:80;server_name 域名 ;index index.html index.htm index.php default.html default.htm default.php;root /home/wwwroot/aaa;include none.conf;#error_page 404 /404.html;# Deny access to PHP files in specific directory#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }include enable-php.conf;location / {if ( !-e $request_filename ) {rewrite ^(.*)$ /index.php?s=/$1 last;break;}}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 12h;}location ~ /.well-known {allow all;}location ~ /\.{deny all;}access_log /home/wwwlogs/日志.log;}443端口(https):
server {listen 443;server_name xsgcweb.iffmd.cn; #填寫綁定證書的域名ssl on;ssl_certificate 1_***_bundle.crt;ssl_certificate_key 2_***.key;ssl_session_timeout 5m;ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照這個協議配置ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照這個套件配置ssl_prefer_server_ciphers on;index index.html index.htm index.php default.html default.htm default.php;root /home/wwwroot/aaa;#include none.conf;#error_page 404 /404.html;# Deny access to PHP files in specific directory#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }include enable-php-pathinfo.conf;location /public/ {if (!-e $request_filename){rewrite ^/public/(.*)$ /public/index.php?s=$1 last;}}location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*\.(js|css)?${expires 12h;}location ~ /.well-known {allow all;}location ~ /\.{deny all;}access_log /home/wwwlogs/日志.log;}轉載于:https://blog.51cto.com/itafei/2345981
總結
以上是生活随笔為你收集整理的nginx.conf配置格式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Shell命令-系统信息及显示之unam
- 下一篇: kinmall分析百度亮剑区块链能否险中