nginx Startseite festlegen führt zu einem 403

Werner S

Member
Hallo,

ich habe vor einiger Zeit auf nginx umgestellt.
Bisher war für ein Forum die Startseite index.php

Nun kam ein Portal dazu, Startseite hat sich auf xt.php?p=portal geändert

Code:
index index.php

habe ich auf

Code:
index xt.php?p=portal;

geändert. Wenn ich nun das Forum aufrufen, springt er immer noch auf die index.php, allerdings mit einem 403. Rufe ich xt.php?p=portal gibt es keinen 403er.

Muss ich noch irgendwas einstellen?

Hier die Gesamte Config

Code:
server {
	server_name forum.domain.de;
	listen 443 ssl;
        port_in_redirect off;

	access_log   /var/log/nginx/domainforum.access.log;
	error_log    /var/log/nginx/domainforum.error.log error;
	
	ssl_certificate /etc/letsencrypt/live/forum.domain.de/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/forum.domain.de/privkey.pem;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;
        ssl_prefer_server_ciphers on;
        ssl_dhparam /etc/ssl/certs/dhparam.pem;
        ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
        ssl_session_timeout 1d;
        ssl_session_cache shared:SSL:50m;
        ssl_stapling on;
        ssl_stapling_verify on;
        add_header Strict-Transport-Security max-age=15768000;

	root /var/www/forum/;
	client_max_body_size 2M;
	
	index xt.php?p=portal;

	location ~ /.well-known {
                allow all;
        }

	location / {
		try_files $uri $uri/ /index.php?$args;
	}

	error_page 401 /err.php?err=401;
	error_page 403 /err.php?err=403;
	error_page 404 /err.php?err=404;
	error_page 500 /err.php?err=500;
	location ~ /\.(ico|pdf|flv|jpg|jpeg|png|gif|js|swf|css|mp3|svg|ttf|woff)$ {
	}
	location ~ /\.(xml|txt)$ {
	}
	if (-f $request_filename){
		set $rule_0 1;
	}
	if (-d $request_filename){
		set $rule_0 1;
	}
	if ($rule_0 = "1"){
		break;
	}
	rewrite /sitemap.xml /xt.php?p=sitemap ;
	rewrite ^/([a-z0-9_-]*-f)([0-9]+)(-([0-9]+)|-(unread)|-(last))?\.html$ /index.php?f=$2&page=$4$5$6 last;
	rewrite ^/([a-z0-9_-]*-c)([0-9]+)?\.html$ /index.php?c=$2 last;
	rewrite ^/([a-z0-9_-]*-l)([0-9]+)?\.html$ /index.php?l=$2 last;
	rewrite ^/([a-z0-9_-]*-t)([0-9]+)(-([0-9]+)|-(unread)|-(last))?\.html$ /topic.php?t=$2&page=$4$5$6 last;
	rewrite ^/([a-z0-9_-]*-p)([0-9]+)(-([0-9]+)|-(unread)|-(last))?\.html$ /topic.php?p=$2&page=$4$5$6 last;
	rewrite ^/([a-z0-9_-]*-u)([0-9]+)\.html$ /usercp.php?u=$2 last;
	if (!-f $request_filename){
		set $rule_8 1;
	}
	if ($rule_8 = "1"){
		rewrite ^/(upload/.*|shared/.*|modules/.*|templates/.*|acp/.*)$ /$1 permanent;
	}
	if (!-f $request_filename){
		set $rule_9 1;
	}
	if ($rule_9 = "1"){
		break;
	}
	# Cache static files for as long as possible
	location ~*.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|cur)$ {
        expires max;
        log_not_found off;
        access_log off;
	}
				
	location ~ \.php$ {
		try_files $uri =404;
		include fastcgi_params;
		fastcgi_pass unix:/run/php/php7.1-fpm.sock;
		fastcgi_split_path_info ^(.+\.php)(.*)$;
		fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
	}      
}

server {
    listen 80;
    server_name forum.domain.de;
    return 301 https://$host$request_uri;
}
 
Last edited by a moderator:
Back
Top