-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Domain redirects always go to mydomain.com/wordpress instead of mydomain.com/home #803
LiamBaisley
started this conversation in
General
-
Hi all,
I have been setting up a Wordpress site using this image and it is running behind nginx (not containerized). When going to https://mydomain.com I am always redirected to https://mydomain.com/wordpress/ which results in a "page not found" error on my site. My home page is located at https://mydomain.com/home/ and I need this to be the default page shown when my domain is accessed. Could anyone suggest how I could accomplish this? My site is displaying correctly when navigating to www.mydomain.com just not when navigating to mydomain.com
Here are my current configurations:
Docker compose:
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: usr
WORDPRESS_DB_PASSWORD: pwd
WORDPRESS_DB_NAME: dbname
WORDPRESS_CONFIG_EXTRA: |
define( 'WP_SITEURL', 'https://mydomain.com' );
define( 'WP_HOME', 'https://mydomain.com' );
volumes:
- wordpress:/var/www/html
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: dbname
MYSQL_USER: usr
MYSQL_PASSWORD: pwd
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
Nginx:
server {
server_name mydomain.com www.mydomain.com;
location / {
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $server_name;
proxy_pass http://127.0.0.1:8080/;
}
listen 443 ssl; # managed by Certbot
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = mydomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name mydomain.com;
return 404; # managed by Certbot
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment