Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@S10CF

[nginx]https接続のnginxでPHPを動かす[PHP]

More than 1 year has passed since last update.

nginxでPHPを動かす

httpではPHPが動くのにhttpsで動かない状態を改善する方法をメモとして残します。

nginx/conf.d/default.conf設定に以下を追加します。
rootフォルダは任意に変更してください。

default.conf
server {
        listen 443 ssl http2;
        server_name sample.com;

        if ($request_uri ~ ^.*/index.html$){
        rewrite ^(.*)/index.html$ $1/ permanent;
        }

        location / {
                root   /html;
                index  index.html index.htm index.php;
        }

        ssl_protocols TLSv1.2;
        ssl_ciphers EECDH+AESGCM:EECDH+AES;
        ssl_ecdh_curve prime256v1;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;

        ssl_certificate /etc/letsencrypt/live/sample.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/sample.com/privkey.pem;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
                root   /html;
        }

        location ~ \.php$ {
        root           /html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        }
}

以上

1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
S10CF
資格:臨床工学技士 臨床ME専門認定士 呼吸療法認定士 透析技術認定士 体外循環技術認定士 不整脈治療専門臨床工学技士 心血管インターベンション技師 医療機器情報コミュニケータ  受賞歴:FileMaker選手権2014 メディカル賞 第64回日本不整脈心電学会メディカルプロフェッショナル優秀演題銀賞 第66回日本不整脈心電学会メディカルプロフェッショナル最優秀演題賞

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?