###前提・実現したいこと
Nginx1.8.1を利用し、SSL接続の設定をしています。
httpsでは問題なく表示されるのですが、URLにポート番号を付けてアクセスすると400エラーになります。
どのように設定したらいいのでしょうか。
https://xx.xx.xx.xx/index.html
上記はページが表示されます。
ブラウザのURLがに、
xx.xx.xx.xx:443/index.html
と入力してアクセスすると、上記は400エラーが表示されます。
###発生している問題・エラーメッセージ
400 Bad Request The plain HTTP request was sent to HTTPS port nginx/1.8.1
###該当のソースコード
server { listen 443 ssl default_server; listen [::]:443 ssl default_server; server_name localhost; client_max_body_size 20M; # root /usr/share/nginx/html; root /var/www/html; index index.php index.html; ssl on; ssl_certificate "/etc/nginx/ssl/hoge.crt"; ssl_certificate_key "/etc/nginx/ssl/hoge.key"; # # It is *strongly* recommended to generate unique DH parameters # # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048 # #ssl_dhparam "/etc/pki/nginx/dhparams.pem"; ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP; ssl_prefer_server_ciphers on; # # # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; # location ~ \.php$ { root /var/www/html; fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param HTTPS on; include fastcgi_params; } location / { try_files $uri $uri.php $uri.html $uri/ 404.html=404; } error_page 404 /404.html; location = /40x.html { } # error_page 500 502 503 504 /50x.html; location = /50x.html { } }
###試したこと
listen [::]:443というのが関連してそうなのですが、何が理由でBadRequestになるかわかりません。
###補足情報(言語/FW/ツール等のバージョンなど)
EC2にてNginx1.8.1+PHP-FPM(7.0)にて利用してます。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。