1
Ubuntu 16サーバにnginxとPHP7をインストールしました。nginx - PHPスクリプト(PHP7)がまだダウンロードされていて実行されていません
which php
/usr/bin/php
を、ここで私のnginxの設定ファイルです:
PHP7は、ここではインストールされている私が正しくPHPを設定への非常に多くの異なるアプローチを試してみた
upstream unicorn {
server unix:/home/deployer/apps/myapp/shared/sockets/unicorn.myapp.sock;
}
server {
listen 443 ssl;
server_name myapp.com;
ssl_certificate /etc/letsencrypt/live/myapp.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/myapp.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/ssl/certs/dhparam.pem;
return 301 https://www.myapp.com$request_uri;
}
server {
#listen 80 default deferred;
listen 443 ssl; # managed by Certbot
server_name www.myapp.com;
root /home/deployer/apps/myapp/current/public;
location ^~ /blog {
alias /home/deployer/blog;
index index.php;
try_files $uri $uri/ /blog/index.php?$args;
#rewrite ^/blog/(.*)+$ /blog/index.php?$1;
}
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
location ~ ^/(robots.txt|sitemap.xml.gz)/ {
root /home/deployer/apps/myapp/current/public;
}
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https; # added because of infinite looping
proxy_redirect off;
proxy_pass http://unicorn;
proxy_read_timeout 120; # added for test purposes
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
ssl_certificate /etc/letsencrypt/live/myapp.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/myapp.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/ssl/certs/dhparam.pem;
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
# Redirect non-https traffic to https
# if ($scheme != "https") {
# return 301 https://$host$request_uri;
# } # managed by Certbot
}
、まだ権利を見つけることができません方法。 PHPスクリプトは、実行されずにダウンロードされています。
キャッシュをクリアしようとしましたが、役に立たなかった。
設定にはまだ何が欠けていますか?