查看“Nginx的那些事”的源代码
←
Nginx的那些事
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
= symbolic= <pre> 有意思的 include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; root@debian:/etc/nginx/sites-enabled# pwd /etc/nginx/sites-enabled root@debian:/etc/nginx/sites-enabled# file default default: symbolic link to /etc/nginx/sites-available/default </pre> =nginx conf= ==80 443 共存== <pre> server { listen 80; listen 443 ssl; server_name www.iamle.com; index index.html index.htm index.php; root /home/wwwroot/www.iamle.com/; #ssl on; 这里要注释掉 ssl_certificate /usr/local/nginx/conf/ssl/www_iamle_com.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/www_iamle_com.key; #以下配置省略 } </pre> =sns= <pre> cat www.cai.net.conf upstream proxy_node_nuxt.net { #fair; #ip_hash; #hash $clientRealIp; #server 176.24.18.94:3333 weight=1 max_fails=2 fail_timeout=10s ; #old #server 172.16.200.14:3333 weight=1 max_fails=2 fail_timeout=10s; } server { listen 80; listen [::]:80; #listen 443 ssl http2; #listen [::]:443 ssl http2; server_name www.cai.net cai.net; # return 301 https://www.cai.net$request_uri; rewrite ^(.*)$ https://$host$1 permanent; } server { listen 443 ssl http2; listen [::]:443 ssl http2; # listen 443 ssl; server_name www.cai.net cai.net; # if ( $host = 'www.cai.net' ) { # rewrite ^/(.*)$ https://www.cai.net/$1 permanent; # } if ( $host = 'cai.net' ) { rewrite ^/(.*)$ https://www.cai.net/$1 permanent; } root /data/www/www.cai.net; index index.html index.htm; ssl_certificate /etc/nginx/ssl/cai.net.crt; ssl_certificate_key /etc/nginx/ssl/cai.net.key; #by evan # if ($scheme = http) { # return 301 https://$server_name$request_uri; # } #by evan location ~ /360_ssp_verify\.txt { root /var/www; } location /nginx_status { stub_status on; access_log off; allow 183.6.50.25; allow 39.104.176.12; allow 45.114.170.162; allow 127.0.0.1; deny all; } location /download/ { root /var/www; } location ^~ /.well-known/pki-validation/ { alias /var/www/pki-validation/; log_not_found off; } merge_slashes off; rewrite ^([^.]*?\/)\/+(.*)$ $1$2 permanent; location / { proxy_pass http://proxy_node_nuxt.net; } ##evan # 去html rewrite ^/(.+)\.html /$1 last; # rewrite ^/info/$ /info/alerts/ last; error_log /var/log/nginx/www.cai.net.error.log; access_log /var/log/nginx/www.cai.net.access.log; # include /etc/nginx/sites-available/blockips.conf; } </pre> [https://www.nginx.cn/install Nginx安装] [https://juejin.im/post/5cdd4d3ee51d456e8240ddca |Nginx-安装与配置(1)] [[category:ops]]
返回至
Nginx的那些事
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
我的导航
关于我
shell
python
ops
linuxchina.net
blog.linuxchina
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息