Nginx - reverse proxy a Ghost blog with /subfolder redirect

前端 未结 3 832
悲&欢浪女
悲&欢浪女 2021-01-14 15:33

I have a working nginx instance with the rules below. But I\'m having difficulties pointing all the requests to domain.com/ghost

I tried modifying the location

3条回答
  •  我在风中等你
    2021-01-14 16:28

    I'm using a regexp location directive for a similar proxy setup. This is the minified configuration file:

    worker_processes  1;
    pid               /path/to/file.pid;
    worker_priority   15;
    
    events {
        worker_connections 512;
        accept_mutex        on;
    }
    
    http {
        server {
            error_log   /path/to/log/error.log error;
            listen      127.0.0.1:9000;
            server_name example.com;
    
            location ~* (/ghost) {
               expires epoch;
               proxy_no_cache 1;
               proxy_pass http://localhost:1234;
            }
    
            location / {
                proxy_pass http://localhost:1234;
            }
        }
    }
    

提交回复
热议问题