前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx配置文件_nginx.conf

Nginx配置文件_nginx.conf

作者头像
CodeWwang
发布2022-08-24 11:09:50
6550
发布2022-08-24 11:09:50
举报
文章被收录于专栏:CodeWwangCodeWwang

留存配置文件,以便需要的时候随时使用

代码语言:javascript
复制
#user nobody; 
worker_processes 1; 
#error_log logs/error.log; 
#error_log logs/error.log notice; 
#error_log logs/error.log info; 
#pid logs/nginx.pid; 
events { 
worker_connections 1024; 
} 
http { 
include mime.types; 
default_type application/octet-stream; 
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
#'$status $body_bytes_sent "$http_referer" ' 
#'"$http_user_agent" "$http_x_forwarded_for"'; 
#access_log logs/access.log main; 
sendfile on; 
#tcp_nopush on; 
#keepalive_timeout 0; 
keepalive_timeout 65; 
server { 
listen 80; 
server_name  域名1; 
#charset koi8-r; 
#access_log logs/host.access.log main; 
location / { 
proxy_pass http://127.0.0.1:4388; 
index index.html index.htm; 
} 
} 
server { 
listen 80; 
server_name 域名2; 
#charset koi8-r; 
#access_log logs/host.access.log main; 
location / { 
proxy_pass http://127.0.0.1:63302; 
index index.html index.htm; 
} 
} 
#HTTPS server 
server { 
listen 443 ssl; 
server_name 域名1; 
ssl on; 
root html; 
index index.html index.htm; 
ssl_certificate cert/xxx.crt; 
ssl_certificate_key cert/xxx.key; 
ssl_session_timeout 5m; 
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
ssl_prefer_server_ciphers on; 
add_header Access-Control-Allow-Credentials true; 
location / { 
proxy_pass http://127.0.0.1:4388; 
root html; 
index index.html index.htm; 
} 
} 
server { 
listen 443 ssl; 
server_name 域名2; 
ssl on; 
root html; 
index index.html index.htm; 
ssl_certificate cert/xxx.crt; 
ssl_certificate_key cert/xxx.key; 
ssl_session_timeout 5m; 
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
ssl_prefer_server_ciphers on; 
add_header Access-Control-Allow-Credentials true; 
location / { 
proxy_pass http://127.0.0.1:63302; 
root html; 
index index.html index.htm; 
} 
} 
} 
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-04-16 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档