我目前有一个运行在80端口上的话语容器。
这是他的nginx配置:
server {
listen 80; listen [::]:80;
server_name discourse.name.com; # <-- change this
location / {
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
此外,我有一个wordpress网站,这是他的docker-compose配置:
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: -
MYSQL_DATABASE: wordpress
MYSQL_USER: -
MYSQL_PASSWORD: -
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: -
WORDPRESS_DB_PASSWORD: -
volumes:
db_data:
但是,我可以在端口8000上看到任何内容。我想让wordpress网站运行在8000上,以便在我访问“ name.com”(名称不是真实域名)时使用80端口将nginx重定向到它。 )。