linux中Nginx的常用配置域名跳转 https cdn配置
发布时间:2022-06-23 10:05:56 所属栏目:Linux 来源:互联网
导读:学习nginx久了我们通常会有一些常用的配置了,下面我给大家整理了Nginx配置中像域名跳转 https域名跳转跳到http或 cdn配置一些例子,希望能帮助各位. www跳转到主域名,代码如下: server { listen 80; server_name www.phpfensi.com; access_log off; error_log
|
学习nginx久了我们通常会有一些常用的配置了,下面我给大家整理了Nginx配置中像域名跳转 https域名跳转跳到http或 cdn配置一些例子,希望能帮助各位. www跳转到主域名,代码如下: server { listen 80; server_name www.phpfensi.com; access_log off; error_log off; return 301 http://tool.lu$request_uri; } http跳转到https,代码如下: server { listen 80; server_name tool.lu; return 301 https://tool.lu$request_uri; } fastcgi,代码如下: location ~ .php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; --phpfensi.com include fastcgi_params; } cdn,代码如下: server { listen 80; server_name s1.tool.lu s2.tool.lu s3.tool.lu s4.tool.lu; root /data/html/tool.lu/static; index index.html; access_log off; error_log off; location / { concat on; concat_types text/css application/javascript; # 解决js语句不以分号结尾的第三方库 concat_delimiter "nn"; concat_max_files 20; expires 7d; } }。 (编辑:珠海站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Linux工具重置英特尔X25固态硬盘磨损平衡表?
- 协处理器是什么 M7协处理器是什么
- fatal: protocol error: bad line length character: This
- SSH只能用于远程Linux主机?那说明你见识不够!
- c – 来自Windows的交叉编译GNU ARM(BeagleBoneBlack). * .
- Linux Lab v0.5 正式推出,功能强大,用法简单
- autonavidata50是什么文件夹?可以删除吗?
- 艾诺迪亚4混沌合成装备常见问题解决
- Linux内核将引入RustLinus以防此事搞砸我又发脾气先道个歉
- pwru一款基于eBPF 的细粒度网络数据包排查工具介绍

