конфиг nginx сервера:
server {
listen 80;
server_name mydomain.ru;
return 301 https://$server_name$request_uri;
}
server {
server_name mydomain.ru;
listen *:443 ssl;
ssl_certificate /etc/letsencrypt/live/mydomain.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.ru/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!AES256";
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/ssl/dhp-4096.pem;
#логи
access_log /var/log/nginx/mydomain.ru.access.log;
error_log /var/log/nginx/mydomain.ru.error.log;
client_max_body_size 16400M;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8080;
}
сервис точно работает локально на localhost:8080, как переадресовать на него запросы?
Сейчас 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 Tue 2020-12-22 21:24:41 +05; 14s ago
Docs: man:nginx(8)
Process: 18882 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 18883 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
дек 22 21:24:40 webserver nginx[18883]: nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
дек 22 21:24:40 webserver nginx[18883]: nginx: [emerg] bind() to [::]:8080 failed (98: Address already in use)
дек 22 21:24:40 webserver nginx[18883]: nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
дек 22 21:24:40 webserver nginx[18883]: nginx: [emerg] bind() to [::]:8080 failed (98: Address already in use)
дек 22 21:24:41 webserver nginx[18883]: nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
дек 22 21:24:41 webserver nginx[18883]: nginx: [emerg] bind() to [::]:8080 failed (98: Address already in use)
дек 22 21:24:41 webserver nginx[18883]: nginx: [emerg] still could not bind()
дек 22 21:24:41 webserver systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
дек 22 21:24:41 webserver systemd[1]: nginx.service: Failed with result 'exit-code'.
дек 22 21:24:41 webserver systemd[1]: Failed to start A high performance web server and a reverse proxy server.
еще есть такой конфиг, судя по сокращению это и есть document-server
# cat /etc/nginx/conf.d/ds.conf
include /etc/nginx/includes/http-common.conf;
server {
listen 0.0.0.0:8080;
listen [::]:8080 default_server;
server_tokens off;
include /etc/nginx/includes/ds-*.conf;