1
私は5つのサーバー構成を設定したリバースプロキシを持っていますが、開始以来、サーバーが起動できないように、指定したポートで待機します。 listen
プロパティを削除しますsites-enabled
nginx-bind()0.0.0.0:80に失敗しました(98:アドレスは既に使用中)
sites-available
と作成シンボリックリンクの内側に複数のファイルに
- 分割設定し、それが変更デフォルト
- にフォールバックすることができます:
は、私はいくつかのことを試してみましたポートを
ipv6only=on
に変更 - これによりエラーが発生しました - ポートを
[::]:80
- に変更する競合が発生しないようにポートをぶら下げ、すなわち、
80
、81
、82
など
netstat
を使用して、私は何も私が必要とするポート上で実行されていない、と私はnginx -t
を実行したとき、私は成功を得ることがわかります構文はokであり、nginx.confのテストは成功しています。
これは私のnginx
出力されます。これが発生した理由を
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:81 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:82 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:83 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:84 failed (98: Address already in use)
は誰もが知っていますか?事前に感謝
は、ここに私のサーバーのconfigsです:
server {
listen 80;
server_name hac-staging-proxy.redant.cloud;
location/{
proxy_pass http://195.219.8.212/;
proxy_set_header Host www.uat2prd.halfordsautocentres.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
}
server {
listen 81;
server_name halfords-c1-staging-proxy.redant.cloud;
location/{
proxy_pass http://195.219.8.206/;
proxy_set_header Host www.c1.uat2prd.halfordsautocentres.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
}
server {
listen 82;
server_name halfords-c2-staging-proxy.redant.cloud;
location/{
proxy_pass http://195.219.8.206/;
proxy_set_header Host www.c2.uat2prd.halfordsautocentres.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
}
server {
listen 83;
server_name halfords-staging-proxy.redant.cloud;
proxy_redirect http://www.uat2prd.halfords.com http://halfords-staging-proxy.redant.cloud;
proxy_redirect https://www.uat2prd.halfords.com https://halfords-staging-proxy.redant.cloud;
location/{
add_header Set-Cookie Experiment=FH;
resolver 127.0.0.1;
proxy_pass http://www.uat2prd.halfords.com;
# sub_filter_types *;
sub_filter 'www.uat2prd.halfords.com' 'halfords-staging-proxy.redant.cloud';
sub_filter 'www.c1.uat2prd.halfords.com' 'halfords-c1-staging-proxy.redant.cloud';
sub_filter 'www.c2.uat2prd.halfords.com' 'halfords-c2-staging-proxy.redant.cloud';
sub_filter_once off;
proxy_set_header Set-Cookie Experiment=FH;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
}
server {
listen 84;
server_name halfords-staging-proxy.redant.cloud2;
proxy_redirect https://www.uat2prd.halfords.com https://halfords-staging-proxy.redant.cloud;
proxy_redirect http://www.uat2prd.halfords.com http://halfords-staging-proxy.redant.cloud;
ssl_certificate /etc/nginx/domain.cert;
ssl_certificate_key /etc/nginx/domain.key;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "INTENTIONALLY REMOVED"
ssl_prefer_server_ciphers on;
location/{
add_header Set-Cookie Experiment=FH;
resolver 127.0.0.1;
proxy_pass https://www.uat2prd.halfords.com;
# proxy_ssl_session_reuse off;
# sub_filter_types *;
sub_filter 'www.uat2prd.halfords.com' 'halfords-staging-proxy.redant.cloud';
sub_filter 'www.c1.uat2prd.halfords.com' 'halfords-c1-staging-proxy.redant.cloud';
sub_filter 'www.c2.uat2prd.halfords.com' 'halfords-c2-staging-proxy.redant.cloud';
sub_filter_once off;
proxy_set_header Set-Cookie Experiment=FH;
proxy_set_header Host www.uat2prd.halfords.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
}