What's wrong with my config?
June 03, 2018 02:03PM
What's wrong with my nginx config?

server {
if ($host = gextension.alter-community.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80 default_server;
listen [::]:80 default_server;

server_name gextension.alter-community.com;
return 404; # managed by Certbot




}

server {
root /var/www/gextension/html;

server_name gextension.alter-community.com; # managed by Certbot
return 404; # managed by Certbot

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot

ssl_certificate /etc/letsencrypt/live/gextension.alter-community.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/gextension.alter-community.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

index index.php index.html index.htm index.nginx-debian.html;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;

# With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

I'm getting 404 Not found when going to a page. It does however redirect to https when I enter http. Please help. It's the correct fpm version and correct root.
Re: What's wrong with my config?
June 08, 2018 12:18PM
Im stupid, I didnt see a leftover return 404. Please close if there even is any mods here.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready