-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
部署方式 #63
Comments
nginx 配置并不是唯一的,需要结合你的部署方式 我只能贴出以下我比较习惯的一种
后端略,具体解释下两个前端,因为我有其它 nodejs 应用,便统一用 pm2 管理,所以这种方式可能并不是最适合你的 前提你的服务器有 nodejs, npm, pm2 这些环境,以 cms 为例
cms 便运行在 8071 端口下,view 同理,修改 最后 nginx 配置如下(https,高版本 nginx 写法可能为 server {
listen 443;
server_name naccl.top;
ssl on;
ssl_certificate naccl.top.pem;
ssl_certificate_key naccl.top.key;
ssl_session_timeout 30m;
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;
location / {
proxy_pass http://127.0.0.1:8072/;
}
}
server {
listen 443;
server_name admin.naccl.top;
ssl on;
ssl_certificate admin.naccl.top.pem;
ssl_certificate_key admin.naccl.top.key;
ssl_session_timeout 30m;
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;
location / {
proxy_pass http://127.0.0.1:8071/;
}
}
server {
listen 443;
server_name api.naccl.top;
ssl on;
ssl_certificate api.naccl.top.pem;
ssl_certificate_key api.naccl.top.key;
ssl_session_timeout 30m;
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;
location /blog/ {
proxy_pass http://127.0.0.1:8070/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
} 可以看出写法因人而异,所以一直懒得贴出来🙁 |
谢谢 |
你好,我前端不做改变,就请求失败,我把前端localhost改成了服务器ip,就只能ip地址加端口号访问了,请问是哪里没配置好吗 |
老哥你好 请问你的nginx配置好了吗 |
嗯嗯,不过很久之前的事了
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年6月18日(周日) 下午4:23
收件人: ***@***.***>;
抄送: "Li ***@***.******@***.***>;
主题: Re: [Naccl/NBlog] 部署方式 (Issue #63)
老哥你好 请问你的nginx配置好了吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
作者求一个联系方式 |
大佬? |
老哥能不能发一手 nignx的配置吗
The text was updated successfully, but these errors were encountered: