'404 Not Found LEMP stack with docker-compose
please help me in this problem
HTTP/1.1 404 Not Found Server: nginx/1.21.5 Date: Tue, 24 May 2022 08:43:32 GMT Content-Type: text/html Content-Length: 153 Connection: keep-alive
404 Not FoundMy docker-compose:
'''
version: '3.9'
services:
mysql:
container_name: mysql
image: mariadb:latest
ports:
- '3306:3306'
volumes:
- ./wordpress/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: mysqlpass
MYSQL_DATABASE: db_name
MYSQL_USER: user_name
MYSQL_PASSWORD: user_pass
wordpress:
container_name: wordpress
image: wordpress:php7.3-fpm-alpine
volumes:
- ./wordpress/html:/var/www/html
depends_on:
- mysql
environment:
WORDPRESS_DB_HOST: mysql
MYSQL_ROOT_PASSWORD: mysqlpass
WORDPRESS_DB_NAME: db_name
WORDPRESS_DB_USER: user_name
WORDPRESS_DB_PASSWORD: user_pass
WORDPRESS_TABLE_PREFIX: wp_
ports:
- '9000:9000'
nginx:
container_name: nginx_reverse_proxy
image: nginx:1.21.5-alpine
ports:
- '80:80'
volumes:
- ./nginx-proxy/nginx.conf:/etc/nginx/nginx.conf
# - ./nginx-proxy/proxy.conf:/etc/nginx/includes/proxy.conf
- ./nginx-proxy/cache/:/etc/nginx/cache
links:
- wordpress
''' and nginx.conf
'''
events { worker_connections 1024; }
http {
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
}
'''
This is my VPS server.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
