nginx docker angular 5平均设置为https

时间:2018-01-10 02:16:26

标签: docker nginx https

我有4个容器使用Docker:client / server / mongo / nginx,在我的一个组件上我有一个按钮,调用v2.steemconnect.com/api/broadcast:1 POST https://v2.steemconnect.com/api/broadcast

这让我在浏览器控制台500中出错。我想知道我的nginx conf有什么问题。如果把服务器拿出来监听443 https,一切正常。但是我的按钮不起作用。 当我在nginx conf中添加服务器时,到客户端的正常路由似乎不再适用于端口80



worker_processes 2 ;

events {
    worker_connections 1024;
}
http {
    upstream my-server {
    server myserver:3000;
    }

    upstream client {
    server client:4200;
    }

    server {
        
        location / {
            proxy_pass http://client;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header X-Forwarded-For $remote_addr;
        }
        location /api/ {
            proxy_pass http://my-server;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header X-Forwarded-For $remote_addr;
    }        
    }
    server {

    listen 443;
    

    ssl_certificate           /etc/nginx/cert.crt;
    ssl_certificate_key       /etc/nginx/cert.key;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

   
    location / {

      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;

      # Fix the “It appears that your reverse proxy set up is broken" error.
      proxy_pass          http://client;
      proxy_read_timeout  90;
      
    }
  }
}






172.18.0.1 - - [11/Jan/2018:16:57:43 +0000] "GET /sockjs-node/info?t=1515689863833 HTTP/1.1" 200 90 "http://localhost/main/(aux:crypto/5a32e59d25b5d2292cc2e919/(blogoutlet:steemblog;access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYXBwIiwicHJveHkiOiJjcnlwdG9vd2xzLmFwcCIsInVzZXIiOiJvdWRla2FhcyIsInNjb3BlIjpbInZvdGUiLCJjb21tZW50Il0sImlhdCI6MTUxNTY4OTg2MCwiZXhwIjoxNTE2Mjk0NjYwfQ.9WjEtZx1vF0a1dr5X376rw9SeeiRzcjXjw_9l5-APX0;expires_in=604800;userName=oudekaas))" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
172.18.0.1 - - [11/Jan/2018:16:57:43 +0000] "GET /api/findPostData HTTP/1.1" 404 155 "http://localhost/main/(aux:crypto/5a32e59d25b5d2292cc2e919/(blogoutlet:steemblog;access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYXBwIiwicHJveHkiOiJjcnlwdG9vd2xzLmFwcCIsInVzZXIiOiJvdWRla2FhcyIsInNjb3BlIjpbInZvdGUiLCJjb21tZW50Il0sImlhdCI6MTUxNTY4OTg2MCwiZXhwIjoxNTE2Mjk0NjYwfQ.9WjEtZx1vF0a1dr5X376rw9SeeiRzcjXjw_9l5-APX0;expires_in=604800;userName=oudekaas))" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
172.18.0.1 - - [11/Jan/2018:16:57:43 +0000] "GET /sockjs-node/236/2jgxtsmj/websocket HTTP/1.1" 400 40 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
172.18.0.1 - - [11/Jan/2018:16:57:54 +0000] "POST /api/updatePost?permlink=bitcoin-review-oudekaas HTTP/1.1" 404 154 "http://localhost/main/(aux:crypto/5a32e59d25b5d2292cc2e919/(blogoutlet:steemblog;access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYXBwIiwicHJveHkiOiJjcnlwdG9vd2xzLmFwcCIsInVzZXIiOiJvdWRla2FhcyIsInNjb3BlIjpbInZvdGUiLCJjb21tZW50Il0sImlhdCI6MTUxNTY4OTg2MCwiZXhwIjoxNTE2Mjk0NjYwfQ.9WjEtZx1vF0a1dr5X376rw9SeeiRzcjXjw_9l5-APX0;expires_in=604800;userName=oudekaas))" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"




0 个答案:

没有答案