非标准端口上的SSL代理后的无限循环

时间:2018-05-30 作者:That Brazilian Guy

我需要在非标准SSL端口(8080)上运行WordPress实例。我使用Docker容器和nginx作为反向代理。

以下是docker-compose.yml:

  wordpress:
    image: wordpress:latest
    # no ports are open besides 80 internally exposed

(...)

  proxy:
    image: jwilder/nginx-proxy
    ports:
      - "8080:8080"
对于nginx.conf:

server {
        server_name domain.com;
        listen 8080 ssl;

        ssl_certificate certs/domain.crt;
        ssl_certificate_key certs/domain.key;

        # Proxy parameters
        #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_buffering on;

       location / {
            proxy_pass      http://wordpress;
       }

1 个回复
最合适的回答,由SO网友:That Brazilian Guy 整理而成

正在更改

proxy_set_header Host $host;

proxy_set_header Host $http_host;

已修复此问题。

(source)

结束

相关推荐

redirect if shortcode exists

WordPress初学者。我试图检查用户请求的页面中是否存在短代码,如果存在,则在用户未登录时重定向。function redirect_to_home() { if (has_shortcode(get_the_content(), \'shortcode\')) { if(!is_admin() && !is_user_logged_in()) { //redirect exit(); }