人生模拟器liferestart部署记录

it不难
2022-07-01 / 0 评论 / 17 阅读 / 正在检测是否收录...

前言

部署

获取代码

git clone https://github.com/VickScarlet/lifeRestart.git  liferestart

使用docker启动

  life:
    build:
      context: ./app2/liferestart/
      dockerfile: Dockerfile
    restart: always
    ports:
      - "8087:8080"
    networks:
      - myblog-net

前端nginx代理配置

# 新增配置
 location /liferestart/ {
      rewrite "^/liferestart/(.*)$"  /$1 break;
      proxy_pass http://172.17.0.10:8087;
      proxy_set_header Host $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-Host $http_host;
      proxy_set_header X-Forwarded-Port $server_port;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_cookie_path / "/; httponly; secure; SameSite=Lax";
      proxy_redirect http:// https://;
      add_header Content-Security-Policy upgrade-insecure-requests;
      add_header 'Access-Control-Allow-Origin' '*';
      add_header 'Access-Control-Allow-Methods' 'GET,POST,DELETE';
      add_header 'Access-Control-Allow-Header' 'Content-Type,*';
    }

0

评论 (0)

取消