awsでのデプロイ を試みています。
nginxを起動すると、
nginx: [warn] conflicting server name "18.177.251.97" on 0.0.0.0:80, ignored
という警告が出てしまい、ページが表示できません。
nginx.conf.default include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }
nginx.conf keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; index index.html index.htm; server { listen 80 default_server; listen [::]:80 default_server; server_name 18.177.251.97; root /var/www/rails/sako_app/public; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } # redirect server error pages to the static page /40x.html # error_page 404 /404.html; location = /40x.html { } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { }
/etc/nginx/conf.d/hoge_app error_log /var/www/rails/hoge_app/log/nginx.error.log; access_log /var/www/rails/hoge_app/log/nginx.access.log; # max body size client_max_body_size 2G; upstream app_server { # for UNIX domain socket setups server unix:/var/www/rails/hoge_app/tmp/sockets/.unicorn.sock fail_timeout=0; } server { listen 80; server_name 18.177.251.97; # nginx so increasing this is generally safe... keepalive_timeout 5; # path for static files root /var/www/rails/hoge_app/public; # page cache loading try_files $uri/index.html $uri.html $uri @app; location @app { # HTTP headers proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://app_server; } # Rails error pages error_page 500 502 503 504 /500.html; location = /500.html { root /var/www/rails/hoge_app/public; } location = /favicon.ico { log_not_found off; } }
nginxの設定ファイルはこのようになっています。
設定ファイルに記入した、IPアドレス18.177.251.97が何かしらのIPと衝突してしまっているのかもしれないと考え、ポート80付近を探してみたのですが、原因が分かりません。どなたか原因が分かる方、いらっしゃいませんか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/03 15:05
2020/01/03 23:19