root@nginx:~# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
root@nginx:~# systemctl status nginx.service
● 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 Mon 2024-05-20 14:45:47 +04; 4s ago
Docs: man:nginx(8)
Process: 746 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 747 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
May 20 14:45:45 nginx systemd[1]: Starting A high performance web server and a reverse proxy server...
May 20 14:45:45 nginx nginx[747]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 14:45:45 nginx nginx[747]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 14:45:46 nginx nginx[747]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 14:45:46 nginx nginx[747]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 14:45:47 nginx nginx[747]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 14:45:47 nginx nginx[747]: nginx: [emerg] still could not bind()
May 20 14:45:47 nginx systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 20 14:45:47 nginx systemd[1]: nginx.service: Failed with result 'exit-code'.
May 20 14:45:47 nginx systemd[1]: Failed to start A high performance web server and a reverse proxy server.
root@nginx:~# netstat -pan | grep ":443"
root@nginx:~#
root@nginx:~# netstat -pan | grep ":443"
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 660/nginx: master p
tcp 0 0 192.168.139.2:443 213.33.142.52:64363 SYN_RECV -
tcp 0 0 192.168.139.2:45350 192.168.67.250:443 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:443 192.168.67.250:47332 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:443 192.168.67.230:48006 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:45394 192.168.67.250:443 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:443 192.168.67.250:52248 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:45420 192.168.67.250:443 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:443 192.168.67.250:48056 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:443 192.168.67.250:54784 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:60346 192.168.67.250:443 ESTABLISHED 661/nginx: worker p
tcp 0 0 192.168.139.2:45432 192.168.67.250:443 ESTABLISHED 661/nginx: worker p
root@nginx:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@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 Mon 2024-05-20 13:16:56 +04; 2s ago
Docs: man:nginx(8)
Process: 1875 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 1876 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
May 20 13:16:53 nginx systemd[1]: Starting A high performance web server and a reverse proxy server...
May 20 13:16:53 nginx nginx[1876]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 13:16:54 nginx nginx[1876]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 13:16:54 nginx nginx[1876]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 13:16:55 nginx nginx[1876]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 13:16:55 nginx nginx[1876]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
May 20 13:16:56 nginx nginx[1876]: nginx: [emerg] still could not bind()
May 20 13:16:56 nginx systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 20 13:16:56 nginx systemd[1]: nginx.service: Failed with result 'exit-code'.
May 20 13:16:56 nginx systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Это явно не весь конфиг. Если бы это был весь конфиг, https://domainname/ у вас бы не работал, вообще.
listen 443 http2 ssl;
Можно. На сервере с IP-адресом 192.168.139.56 в качестве источника IP-адреса клиента используйте HTTP-заголовок X-Forwarded-For или X-Real-IP.
server {
server_name my.site.ru/redirect/;
return 302 http://www.blog.mysite2.ru;
}
server name "my.site.ru/redirect/" has suspicious symbols
так же строчку в конфигах с listen 8443 ssl http2; поменял на listen 443 ssl http2;
пока вроде работает.
так же стало отображаться в логах реальный ip а не 127.0.0.1