0

On mywebsite.com, I have running docker container with wordpress. I started it as

docker run -p 8000:80 --name docker-wordpress-nginx -d 

and

docker ps

shows

0.0.0.0:8000->80/tcp

and on my host I have nginx running with

server {
     listen   80;
...
server_name mywebsite.com www.mywebsite.com;
...
location / {
             proxy_pass http://localhost:8000/;
             proxy_set_header Host $host;
    }

when i go here

mywebsite.com

It brings wordpress index page of my site, but address in browser is now

mywebsite.com:8000

instead of

mywebsite.com

which I expected. Everything looks as i wanted except that I always get that port number in address

http://mywebsite.com:8000/2015/08/01/hello-world/

Instead, I wanted

http://mywebsite.com/2015/08/01/hello-world/

i mean, in general, instead of

http://mywebsite.com:8000/some_blog/

i want

http://mywebsite.com/some_blog/

Any ideas?

1 Answers1

0

You need to setup your Wordpress site URL into yours. Read Changing the Site URL.

One of solutions is modified your wp-config.php file. Add/replace the following configuration:

define('WP_HOME','http://mywebsite.com');
define('WP_SITEURL','http://mywebsite.com');

If you don't have any other site in port 80, you can simply expose your port 80 into Wordpress port.

Edward Samuel
  • 791
  • 7
  • 9
  • Great! It works exactly as I wanted. Thanks a lot Edward! – Darko Stefanovic Aug 01 '15 at 16:57
  • You're welcome @DarkoStefanovic. Are you new here? If you feel this answer is good and solve your problem, please accept the answer by click the check mark beside the answer :) – Edward Samuel Aug 01 '15 at 17:22
  • Hello, I am new. And i will do that now. I have another-additional related question though, when i go to mywebsite.com/wp-admin it redirects to /wp-login.php and displays "File not found". So, it seems that i need to set those variables somewhere else, or some other variables. Should I post another/different question about this? – Darko Stefanovic Aug 01 '15 at 20:57
  • Are your /wp-login.php exist? – Edward Samuel Aug 01 '15 at 23:05
  • Yup, you can create a new one. I thought it is a new problem and might be not so related with your main question here. – Edward Samuel Aug 01 '15 at 23:07