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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
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:
Also, you could take a look at this answer here on how to host multiple Docker containers one server with Nginx:
https://www.digitalocean.com/community/questions/how-to-host-multiple-docker-containers-on-a-single-droplet-with-nginx-reverse-proxy
Hope that this helps! Regards, Bobby