項目地址 docker vue項目
git clone https://github.com/devdocker/dao-vuecp -r dao-vue vueitem
vueitem 是你的vue項目地址
如果你用過daocloud ,請去創建一個項目,編譯發布,設置觸發條件,自動化發布到你的主機。
當然部署到你的服務器上后,把端口寫死,不要動態的。
配置如下
upstream webfenxi {
server 127.0.0.1:8083; # 這是服務器使用docker啟動的端口
}
server
{
listen 80;
#listen [::]:80;
server_name webfenxi.com ; # 這是綁定的自己的域名
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/webfenxi.com;include other.conf;
#error_page 404 /404.html;# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }include enable-php.conf;
location / {
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;proxy_set_header X-Nginx-Proxy true;
proxy_pass http://webfenxi; # 代理地址
proxy_redirect off;
# try_files $uri $uri/ /index.html;
}location /v1/ {
proxy_pass http://api.xxxx.com/v1/; #代理的接口,解決跨域問題
}location ~ /.well-known {
allow all;
}location ~ /\.
{
deny all;
}access_log /home/wwwlogs/webfenxi.com.log;
}
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com