Browse Source

fix: 尝试修复部署bug

weijin 5 years ago
parent
commit
bdcf40cb0e
3 changed files with 3 additions and 126 deletions
  1. 1 1
      Dockerfile
  2. 0 124
      nginx.conf
  3. 2 1
      nuxt.config.js

+ 1 - 1
Dockerfile

@@ -6,5 +6,5 @@ RUN npm i && npm run generate
 
 
 FROM nginx:latest
-COPY nginx.conf /etc/nginx/
+#COPY nginx.conf /etc/nginx/
 COPY --from=base dist /var/www/p.seec.seecoder.cn/public/

+ 0 - 124
nginx.conf

@@ -1,124 +0,0 @@
-# Generated by nginxconfig.io
-# https://www.digitalocean.com/community/tools/nginx?domains.0.server.redirectSubdomains=false&domains.0.https.https=false&domains.0.php.php=false&domains.0.reverseProxy.reverseProxy=true&domains.0.reverseProxy.path=%2Fapi&domains.0.routing.index=index.html&domains.0.routing.fallbackHtml=true&domains.0.routing.fallbackPhp=false&global.nginx.user=nginx&global.nginx.pid=%2Fvar%2Frun%2Fnginx.pid&global.docker.dockerfile=true&global.tools.modularizedStructure=false&global.tools.symlinkVhost=false&global.app.lang=zhCN
-
-user                 nginx;
-pid                  /var/run/nginx.pid;
-worker_processes     auto;
-worker_rlimit_nofile 65535;
-
-# Load modules
-include              /etc/nginx/modules-enabled/*.conf;
-
-events {
-    multi_accept       on;
-    worker_connections 65535;
-}
-
-http {
-    charset                utf-8;
-    sendfile               on;
-    tcp_nopush             on;
-    tcp_nodelay            on;
-    server_tokens          off;
-    log_not_found          off;
-    types_hash_max_size    2048;
-    types_hash_bucket_size 64;
-    client_max_body_size   16M;
-
-    # MIME
-    include                mime.types;
-    default_type           application/octet-stream;
-
-    # Logging
-    access_log             /var/log/nginx/access.log;
-    error_log              /var/log/nginx/error.log warn;
-
-    # Connection header for WebSocket reverse proxy
-    map $http_upgrade $connection_upgrade {
-        default upgrade;
-        ""      close;
-    }
-
-    # Load configs
-    include /etc/nginx/conf.d/*.conf;
-
-    # example.com
-    server {
-        listen                             80;
-        listen                             [::]:80;
-        server_name                        p.seec.seecoder.cn;
-        root                               /var/www/p.seec.seecoder.cn/public;
-
-        # security headers
-        add_header X-Frame-Options         "SAMEORIGIN" always;
-        add_header X-XSS-Protection        "1; mode=block" always;
-        add_header X-Content-Type-Options  "nosniff" always;
-        add_header Referrer-Policy         "no-referrer-when-downgrade" always;
-        add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
-
-        # . files
-        location ~ /\.(?!well-known) {
-            deny all;
-        }
-
-        # index.html fallback
-        location / {
-            try_files $uri $uri/ /index.html;
-        }
-
-        # reverse proxy
-        location /api {
-            proxy_pass                         http://environment-24-71.seec.svc.cluster.local;
-            proxy_http_version                 1.1;
-            proxy_cache_bypass                 $http_upgrade;
-
-            # Proxy headers
-            proxy_set_header Upgrade           $http_upgrade;
-            proxy_set_header Connection        $connection_upgrade;
-            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-Proto $scheme;
-            proxy_set_header X-Forwarded-Host  $host;
-            proxy_set_header X-Forwarded-Port  $server_port;
-
-            # Proxy timeouts
-            proxy_connect_timeout              60s;
-            proxy_send_timeout                 60s;
-            proxy_read_timeout                 60s;
-        }
-
-        # favicon.ico
-        location = /favicon.ico {
-            log_not_found off;
-            access_log    off;
-        }
-
-        # robots.txt
-        location = /robots.txt {
-            log_not_found off;
-            access_log    off;
-        }
-
-        # assets, media
-        location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
-            expires    7d;
-            access_log off;
-        }
-
-        # svg, fonts
-        location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
-            add_header Access-Control-Allow-Origin "*";
-            expires    7d;
-            access_log off;
-        }
-
-        # gzip
-        gzip            on;
-        gzip_vary       on;
-        gzip_proxied    any;
-        gzip_comp_level 6;
-        gzip_types      text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
-    }
-}
-

+ 2 - 1
nuxt.config.js

@@ -84,7 +84,8 @@ module.exports = {
   },
   proxy: {
     '/api/': {
-      target: 'http://environment-24-71.seec.svc.cluster.local:8080' // 代理地址
+      target: 'http://localhost:8080' // 代理地址
+      // target: 'https://p-server.seec.seecoder.cn' // 代理地址
       // changeOrigin: true,
       // pathRewrite: {
       //   '^/api': ''