在配置Nginx端口代理与域名指向这里,进入/etc/conf.d里面是空的,接下来要怎么弄呢
来源:1-8 配置 Nginx 端口代理与域名指向
爱偷懒的小码农
2018-05-18
写回答
3回答
-
在里面新建文件就好了,后缀是 .conf
022018-10-09 -
Scott
2018-10-11
比如这是我的一个
upstream iceandfire { server 127.0.0.1:3005; } server { listen 80; server_name iceandfire.xxx.com; #rewrite ^(.*) https://$host$1 permanent; return 301 https://iceandfire.xxx.com$request_uri; } server { listen 443; server_name iceandfire.xxx.com; #填写绑定证书的域名 ssl on; ssl_certificate /www/ssl/214680368210040.pem; ssl_certificate_key /www/ssl/214680368210040.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; if ($ssl_protocol = "") { rewrite ^(.*) https://$host$1 permanent; } location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; proxy_pass http://iceandfire; proxy_redirect off; } location ~* ^.+\.(txt) { root /www/icefire/public; } }
00 -
Scott
2018-05-23
比如 movie.conf
upstream movie { server 127.0.0.1:3001; } server { listen 80; server_name movie.iblack7.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; proxy_pass http://movie; proxy_redirect off; } location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /www/movie/production/current/public; } }
00
相似问题