react部署在nginx上的配置

ps -ef |grep nginx
找到配置文件,在http下面添加即可
server {
    listen  9090;
    server_name localhost 192.168.1.94 avic.XXXX.com ;
    location / {
        root  /iot/extronweb/dist/; #這個目錄是打包之後的目錄
        index index.html index.htm; #這個是目錄下面的一頁
        try_files $uri /index.html; #$uri 是前面root的值
        }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root html;
        }
}

然後重啓nginx,因爲我的nginx和gitlab是在一塊的,所以每次使用gitlab-ctl stop gitlab start進行重啓。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章