By emanuelrahn
Okay, so I got wordpress and nginx running on docker. Everything works fine. Except for some reason (probably me being stupid) I can’t open my site without adding the port in the url. so example.com:9000 I want just example.com. I don’t understand. I’m getting frustrated. Please. Send. HALP.
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, @emanuelrahn
What you can do in order to achieve this is to set a Nginx reverse proxy. You can do this by editing the nginx configuration file:
open/create the config file /etc/nginx/sites-available/domain.com
You should have the following content:
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://localhost:9000;
}
}
You need to create the symlink for the file and make it available in the sites-enabled directory as well:
sudo ln -s /etc/nginx/sites-available/domain.com /etc/nginx/sites-enabled/domain.com
Then check the Nginx configuration files for any syntax errors:
sudo nginx -t
If you see that the Syntax is Okay, then restart Nginx. If you get some syntax errors, check the exact row/line that was reported in the message and sort this out before you continue further.
sudo systemctl restart nginx
You can also see this amazing video tutorial on how to do this on a DigitalOcean droplet:
https://www.youtube.com/watch?v=spbkCihFpQ8
Hope this helps!
Regards, Alex
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.