불행히도 NGINX를 시작할 수 없습니다. systemctl status nginx 명령을 실행하면 다음 메시지가 표시됩니다:
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2024-03-08 07:06:36 CST; 1h 14min ago
Docs: man:nginx(8)
Process: 27329 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 27330 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 42ms
Mar 08 07:06:33 vmi1695712.contaboserver.net systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 08 07:06:33 vmi1695712.contaboserver.net nginx[27330]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Mar 08 07:06:34 vmi1695712.contaboserver.net nginx[27330]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Mar 08 07:06:34 vmi1695712.contaboserver.net nginx[27330]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Mar 08 07:06:35 vmi1695712.contaboserver.net nginx[27330]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Mar 08 07:06:35 vmi1695712.contaboserver.net nginx[27330]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
Mar 08 07:06:36 vmi1695712.contaboserver.net nginx[27330]: nginx: [emerg] still could not bind()
Mar 08 07:06:36 vmi1695712.contaboserver.net systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Mar 08 07:06:36 vmi1695712.contaboserver.net systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 08 07:06:36 vmi1695712.contaboserver.net systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Discourse를 위한 제 사이트 파일:
# Default server configuration
#
server {
# listen 80 default_server;
# listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name forum.ictsharks.com;
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;
proxy_set_header X-Real-IP $remote_addr;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
여러 번 확인해 보았지만, 오류가 어디서 나는지 파악하지 못하고 있습니다.
죄송합니다. 저는 Linux / NGINX / Docker 관련해서는 초보입니다. 조언을 주시면 감사하겠습니다. 감사합니다.
## 이 컨테이너는 어떤 TCP/IP 포트를 노출해야 하나요?
## Apache나 nginx 같은 다른 웹서버와 포트를 공유하려면
## 자세한 내용은 https://meta.discourse.org/t/17247 을 참고하세요
expose:
# - "80:80" # http
# - "443:443" # https
DNS 레코드, https, 인증서는 잘 알고 있습니다. 나머지 부분만 제게는 새로운 내용입니다.
말씀드린 대로, 다른 NGIX(WordPress용)가 MySQL과 WordPress와 함께 컨테이너 안에서 작동한다고 생각합니다.
docker ps 명령을 실행하면 다음과 같은 결과가 나옵니다:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ca4cbec2c88 local_discourse/app "/sbin/boot" 51 minutes ago Up 15 minutes app
4a3ebdd9f5b5 nginx:1.15.12-alpine "nginx -g 'daemon of…" 20 hours ago Up 15 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp webserver
42c4211a2fb6 wordpress:5.1.1-fpm-alpine "docker-entrypoint.s…" 2 days ago Up 15 minutes 9000/tcp wordpress
5b588a7435ad mysql:8.0 "docker-entrypoint.s…" 2 days ago Up 15 minutes 3306/tcp, 33060/tcp db
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ca4cbec2c88 local_discourse/app "/sbin/boot" 3 hours ago Up 2 hours app
42c4211a2fb6 wordpress:5.1.1-fpm-alpine "docker-entrypoint.s…" 2 days ago Up 2 hours 9000/tcp wordpress
5b588a7435ad mysql:8.0 "docker-entrypoint.s…" 2 days ago Up 2 hours 3306/tcp, 33060/tcp db
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 418/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 462/sshd: /usr/sbin
tcp6 0 0 :::22 :::* LISTEN 462/sshd: /usr/sbin
udp 0 0 127.0.0.53:53 0.0.0.0:* 418/systemd-resolve