查看: 5|回覆: 0

nginx配置jar包设置绑定域名访问

[複製鏈接]

2

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2008-5-2
發表於 2020-8-5 13:44:00 | 顯示全部樓層 |閲讀模式

后台启用jar包,然后绑定对应端口域名:

nohup java -jar abc.jar --spring.profiles.active=test >abc.txt &

.conf文件如下:

server {
        listen 80;
        server_name t.abc.com;

        index index.php index.html index.htm;
        location /{
            proxy_pass http://127.0.0.1:8012/;
                        
            proxy_set_header    Host    $http_host;
            proxy_set_header    X-Real-IP   $remote_addr;
            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-For $remote_addr;
        }

 }

  

proxy_pass 地址端口需要跟配置文件中的 server:port相同。



来源:https://www.cnblogs.com/todarcy/p/13439279.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部