So I spent the better part of last night trying to get my ec2 instance setup with nginx and php7.2. I got everything installed and I edited the server block in my nginx.conf with the values I thought needed to be there...and I had 502 errors for about an hour. But, I troubleshot that, and now I'm to a point where all I have is a blank screen. (my domain is shinesolar.app by the way). Here is my nginx config for php:
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#include fastcgi_params;
}
And I understand that almost everything there is commented out, but that is because I'm pretty sure that's the only thing I needed. What did I do wrong here?
Also, for completeness sake, I have an index.php in my webroot that is supposed to echo phpinfo();
EDIT:
There is nothing in /var/log/nginx/error.log
EDIT #2
Here is my current php config:
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Edit 3
server {
listen 443 ssl http2;
server_name shinesolar.app www.shinesolar.app;
access_log /var/www/access_log/webserver_access.log;
root /var/www/public_html;
location / {
try_files $uri $uri/ @proxy
autoindex off;
}
location @proxy {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/letsencrypt/live/shinesolar.app/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/shinesolar.app/privkey.pem; # managed by Certbot
}
server {
if ($host = www.shinesolar.app) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = shinesolar.app) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name shinesolar.app www.shinesolar.app;
return 404; # managed by Certbot
}