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配置格式相关推荐
- linux系统下nginx安装目录和nginx.conf配置文件目录
linux系统下nginx安装目录和nginx.conf配置文件目录 1.查看nginx安装目录 输入命令 # ps -ef | grep nginx 返回结果包含安装目录 root 26 ...
- nginx.conf配置详解
######Nginx配置文件nginx.conf中文详解######定义Nginx运行的用户和用户组 user www www;#nginx进程数,建议设置为等于CPU总核心数. worker_pr ...
- Nginx - 正反向代理,nginx.conf配置
Nginx (engine x) 是一个轻量级的高性能的HTTP和反向代理web服务器及电子邮件(IMAP/POP3)代理服务器. Nginx 是由俄罗斯人 Igor Sysoev 采用C语言开发编写 ...
- 【nginx】配置nginx.conf 配置多个代理
当我们的Vue项目中有多个代理时,前端webpack中 proxy:{//匹配字段'/proxyApi': {//代理地址target: 'http://192.0.0.0:7080',changeO ...
- 使用nginx部署简单的前端项目,nginx.conf配置
前端项目监听8080端口 项目位于/usr/webfront/tcyx/ 既是:root变量,是项目静态资源的绝对位置 index代表默认项目首页网页 第二个location是后端代理 servern ...
- nginx 从vagant挂载目录中加载nginx.conf配置进行开机启动
nginx从vagrant挂载目录中读取配置启动,将nginx加入开机启动项!开机启动的时候nginx会因为加载不了配置导致启动失败! 原因是开机启动nginx服务在vagrant挂载之前,导致无法正 ...
- nginx.conf 基本配置模板和结构
文章目录 配置 nginx.conf 配置结构 nginx.conf 基本配置模板 如何验证效果 配置 nginx.conf 配置结构 ... #全局块 events { #events块 ... } ...
- nginx.conf添加lua.conf配置
1.在nginx的conf下配置lua.conf......vi lua.conf server { listen 80; server_name _;location /lua { default_ ...
- 三、nginx服务的nginx.conf的参数配置解析
前一篇:二.nginx服务的nginx.conf配置参数解析 后一篇:四.nginx服务器的参数配置解析 目录 一.虚拟主机设定模块 1.upstream模块配置样式 1.1.默认配置 1.2.wei ...
最新文章
- 关于python语言的浮点数类型_Python 浮点数数据类型详解(float)[学习 Python 必备基础知识][看此一篇就够了]...
- 文巾解题 100. 相同的树
- android 解决Error:This Gradle plugin requires Studio 3.0 minimum
- 让软件不在添加删除程序_功能强大却鲜为人知的四款软件,一但发现就无法自拔...
- .net函数查询_SQL查询语句总是先执行SELECT?你们都错了!
- 学习 SCCM 2012 的思路
- AngularJS transclude 理解及例子
- 机器学习笔记(二十三):算法精准率、召回率
- Laravel框架壁纸图库图片上传下载程序源码
- 不同vlan实现互通
- 通过批处理文件bat批量修改图片名称
- H264解析sps提取宽高(好用)
- 基于jsp(java)高校学生考勤管理系统设计与实现
- Android 自带的应用统计服务(UsageStatsService)
- 三星a5100多少钱_请问三星A5100现在啥价格?
- C++ 成员函数连续调用
- 专业版网上企业订货平台-移讯云订货系统
- 孟岩:算力是新数字经济的支点,去中心化网络资产规模将达10万亿美元
- 【SQL开发实战技巧】系列(八):聊聊如何插入数据时比约束更灵活的限制数据插入以及怎么一个insert语句同时插入多张表
- 应该怎么和大学毕业论文的指导老师沟通?