Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add an other proxy before #8

Open
CondormanFr opened this issue Nov 1, 2017 · 1 comment
Open

How to add an other proxy before #8

CondormanFr opened this issue Nov 1, 2017 · 1 comment

Comments

@CondormanFr
Copy link

CondormanFr commented Nov 1, 2017

Hi,
Nice work. I'm able to make it working alone.
But in my case, In my docker-compose file with other services, I want mediawiki available behind an nginx proxy at the address : http://docker/wiki

For nginx (listening on port 80), I my default.conf, I have :

location /wiki {
            proxy_pass http://proxy:8090;
            proxy_set_header X-Real-IP  $remote_addr;
            proxy_set_header HOST $host;
            proxy_set_header X-Forwarded-For $remote_addr;

and in the docker compose, i set :

proxy:
        image: pastakhov/varnish-mediawiki:1.0
        depends_on:
            - web
            - restbase
        ports:
            - "8090:80"
        networks:
          - prodnetwork    
        environment:
            - PROXY_BACKEND_web=web:80
            - PROXY_BACKEND_restbase=restbase:7231
            - PROXY_RESTBASE_BACKEND=restbase
            - PROXY_RESTBASE_URL=^/api/rest_v1
            - PROXY_RESTBASE_SUB=/{backend_hint}/v1

    web:
        build: 
            context: ./web
            dockerfile: Dockerfile
        depends_on:
            - db
            - elasticsearch
            - memcached
            - parsoid
            - restbase
        networks:
          - prodnetwork    
        environment:
            - MW_SITE_SERVER=//docker/wiki
            - MW_SITE_NAME=MediaWiki

docker is the name of my host.

In nginx log, I have :

 2017-11-01T07:24:05.623517833Z 2017/11/01 07:24:05 [error] 10#10: *25 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.60.5, server: docker, request: "GET /wiki/Accueil HTTP/1.1", upstream: "http://172.20.0.21:8090/wiki/Accueil", host: "docker"
2017-11-01T07:24:05.623772705Z 192.168.60.5 - - [01/Nov/2017:07:24:05 +0000] "GET /wiki/Accueil HTTP/1.1" 502 537 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" "-"

Thanks for your help

@pastakhov
Copy link
Owner

Hi, thanks.
The mediawiki configuration will be the same in any case, use the proxy before or don't.
But only one thing - when a wiki page changed, the proxy server cache (if one is used) should be purged.
Mediawiki send purge command to proxy servers listed in https://www.mediawiki.org/wiki/Manual:$wgSquidServers variable. You can configure it via the MW_PROXY_SERVERS env var.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants