欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > 如何在docker上部署前端nginx服务(VUE)

如何在docker上部署前端nginx服务(VUE)

2025/2/28 2:29:59 来源:https://blog.csdn.net/weixin_42759398/article/details/145881202  浏览:    关键词:如何在docker上部署前端nginx服务(VUE)

目录结构

clean.sh

docker stop rszWeb;
docker rm rszWeb;

start.sh

docker run -d \
--name rszWeb \
-p 7084:80 \
-m 500m \
--privileged=true \
--restart=always \
-v /home/rsz/ui/conf/nginx.conf:/etc/nginx/nginx.conf \
-v /home/rsz/ui/logs:/meta/logs \
-v /home/rsz/ui/dist:/meta/plateform \
nginx:latest

然后是ngxin的配置


user  root; #nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';access_log  /meta/logs/access.log  main;error_log  /meta/logs/error.log;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  300s;gzip  on;upstream plateformServer {server 85.69.80.38:8080;}server {listen       80;server_name  localhost;#rewrite ^(.*)$ https://$host$1 permanent;client_max_body_size 1024M;location / {root   /meta/plateform;try_files $uri /index.html;index  index.html index.htm;}location /api{proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;rewrite ^/api/(.*)$ /$1 break;proxy_pass  http://85.69.80.38:8080/;proxy_connect_timeout 300;proxy_read_timeout 300;

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词