![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nginx
wangooo
这个作者很懒,什么都没留下…
展开
-
nginx强制跳转到https
nginx的rewrite方法将所有的http请求通过rewrite重写到https上即可server { listen 80; server_name test.com; // 这是nginx早前的写法,现在还可以使用 rewrite ^(.*)$ https://$host$1 permanent; }301server { listen 80; server_name test.com; // 这是ngi原创 2021-09-25 17:07:17 · 1099 阅读 · 0 评论 -
nginx 反向代理 proxy_pass
1、假设server_name为www.xxx.com当请求http://www.xxx.com/aming/a.html的时候,以上示例分别访问的结果是示例1:location /amazing/ { proxy_pass http://192.168.1.10; ...}结果1:http://192.168.1.10/aming/a.html示例2:location /amazing/ { proxy_pass http://192.168.1.10/;原创 2020-10-26 15:13:23 · 518 阅读 · 0 评论 -
centos7 安装 nginx
1. 添加yum源sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm2. 安装sudo yum install -y nginx3. 重启服务sudo systemctl start nginx.service4. 设置开机启动systemctl enable nginx.service转自:https:/.转载 2020-10-17 22:22:52 · 86 阅读 · 0 评论