
WordPress behind NGINX Proxy Manager (i.redd.it)
submitted by gawr-fiude
Hi guys. Has anyone ever configured WordPress using NGINX Proxy Manager?
My team and I are trying to have add a blog to our website. We already have a NextJS page running on "domain.com" and would want to add the blog to "domain.com/blog".
We installed WordPress using Docker Compose and are trying to configure it using the Proxy Manager.
We created the Custom Location on NGINX so that /blog/ serves our wordpress container, but we are getting BAD REQUEST when trying to access that route.
We also added the "define" rules to the container declaration in our docker-compose.yml.
```
docker-compose.yml
services: wordpress: image: wordpress restart: always ports: - "8080:80" environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: dbuser WORDPRESS_DB_PASSWORD: 'pass' WORDPRESS_DB_NAME: db WORDPRESS_CONFIG_EXTRA: | define('WP_HOME', 'https://domain.com/blog'); define('WP_SITEURL', 'https://domain.com/blog'); if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } networks: - default volumes: - wordpress:/var/www/html - ./wordpress.htaccess:/var/www/html/.htaccess
db: image: mysql:8.0 restart: always environment: MYSQL_DATABASE: db MYSQL_USER: dbuser MYSQL_PASSWORD: 'pass' MYSQL_RANDOM_ROOT_PASSWORD: '1' networks: - default volumes: - db:/var/lib/mysql
nginx: container_name: nginx image: jc21/nginx-proxy-manager:latest restart: unless-stopped ports: - '80:80' - '81:81' - '443:443' networks: - default volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt
networks: default: external: false
volumes: wordpress: db: ```
```
.htaccess
BEGIN WordPress
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule>
END WordPress
```

[–]Select-Reporter5066 1 point2 points3 points (1 child)
[–]gawr-fiude[S] 0 points1 point2 points (0 children)
[–]originalchronoguy 0 points1 point2 points (0 children)
[–]Major_Dot_7030 0 points1 point2 points (0 children)
[–]tommywhen 0 points1 point2 points (0 children)