By Mauro
Hi all!
I created a website using WordPress and next.js, all using Docker. My frontend part (next.js) is exposed on port 80 so I can see my site when I write the correct URL. Wordpress is exposed to port 8080 and to access my admin part I need to write MY_IP:8080/wp-admin/.
I would like to find a way to see the content of MY_IP:8080/wp-admin/ every time I write the URL of my website like this MY_URL/wp-admin/ but of course, continuing to see the URL with the right name of my site (MY_URL/wp-admin/) and not with MY_IP:8080/wp-admin/.
Of course, I need this logic also for any subfolder/file when the path starts with wp-admin (i.e. MY_URL/wp-admin/post.php?post=320&action=edit).
Does somebody know what I need to check for making this possible?
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,
What you could do is install Nginx and use it as a reverse proxy for your Wordpress website which is running inside your Docker container on port 8080.
The Nginx reverse proxy that you could use, should look something like this:
server {
listen 80;
server_name www.yourdomain.com; # change this
# global gzip on
gzip on;
gzip_min_length 10240;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
add_header Cache-Control public;
location / {
proxy_pass http://127.0.0.1:8080; # change this
proxy_buffering on;
proxy_buffers 12 12k;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
Also, you could take a look at this answer here on how to host multiple Docker containers one server with Nginx:
Hope that this helps! Regards, Bobby
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.