By inteligencia
Hello everyone,
I have an environment with 3 containers and I also have a domain www.example.com with my app in production.
I would like to implement mediawiki with the pattern address like www.exemple.com/wiki
I tried to redirect any call for www.exemple.com/wiki to my mediwiki container and it works, but the address changes to www.exemple.com:8080/wiki
This is my compose file:
...
app:
build: ./app
command: python manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
nginx:
build: ./nginx
ports:
- 80:80
- 443:443
wiki:
build: ./wiki
ports:
- 8080:80
And this is the nginx.conf
upstream example {
server app:8000;
}
upstream wiki {
server wiki:80;
}
server {
listen 80;
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
client_max_body_size 32m;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
location / {
proxy_pass http://example;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /static/ {
alias /home/app/web/static/;
}
location /wiki {
proxy_pass http://wiki;
rewrite ^/wiki(.*) /$1 break;
}
}
There is a way to configure it and stop showing its port address? What i’m missing? if there is a better way to do that, I’m open to suggestions.
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
Your configuration looks correct actually.
What happens when you visit your IP address on port 80?
You can take a look at this answer here but your approach is also correct:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.