Answer the question
In order to leave comments, you need to log in
Logout gives ERR_INVALID_REDIRECT error, how to get out?
Hello.
When accessing /index.php?action=logout , an ERR_INVALID_REDIRECT error occurs , and the user will still be logged out.
there is no rewrite on logout, while the CMS developer himself says that it is not needed.
So is Origin CA from CloudFlare.
Port 80 is redirected by 302 to port 443.
upstream php {
server phpfpm:9000;
}
server {
listen 80;
listen [::]:80;
server_name mysite.ru www.mysite.ru;
return 302 https://$server_name$request_uri;
}
server {
resolver 1.1.1.1 1.0.0.1 valid=300s;
resolver_timeout 5s;
# listen 80;
# listen [::]:80;
# SSL configuration
listen 443 ssl http2;
listen [::]:443 ssl http2;
# ssl on;
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
ssl_client_certificate /etc/ssl/certs/cloudflare.crt;
ssl_verify_client on;
#Show real IP users, CloudFlare Fix!
set_real_ip_from 1.1.1.1;
set_real_ip_from 1.0.0.1;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
real_ip_header CF-Connecting-IP;
index index.php;
server_name mysite.ru www.mysite.ru;
# server_name mysite.ru www.mysite.ru;
error_log "/opt/bitnami/nginx/logs/myapp-error.log";
access_log "/opt/bitnami/nginx/logs/myapp-access.log";
root /myapps/www/mysite;
# location ~ \.php$ {
# include fastcgi.conf;
# fastcgi_intercept_errors on;
# fastcgi_pass php;
# fastcgi_cache fastcgicache;
# fastcgi_cache_valid 200 60m;
# }
location ~* \.(js|css|png|jpg|jpeg|svg|gif|ico)$ {
expires max;
log_not_found off;
}
gzip on;
gzip_comp_level 8;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
fastcgi_cache_key "$scheme$request_method$host$request_uri$cookie_codeAuth";
set $no_cache 1;
if ($request_method != GET) {
set $no_cache 1;
}
if ($query_string != "") {
set $no_cache 1;
}
if ($request_uri != "/") {
set $no_cache 1;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
add_header x-fastcgi-cache $upstream_cache_status;
location ~ \.php$ {
fastcgi_cache fastcgicache;
fastcgi_cache_valid 200 10m;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
fastcgi_cache_min_uses 1;
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
#DLE
location ~* (uploads|uploads/fotos|templates|language)/.+\.php {
deny all;
}
# location ~* /templates/.+\.tpl {
# deny all;
# }
# Указываем расширения файлов, которые можно использовать в каталоге:
location ~ \.tpl$ {
return 302 https://$server_name$request_uri;
}
location /sitemap {
rewrite ^/sitemap/*$ /?do=sitemap break;
}
location ~ /\.ht {
deny all;
}
# Редиректы
rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
# Сам пост
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /index.php?mod=print&subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?mod=print&news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?mod=print&news_page=$1&newsid=$2&seourl=$3 last;
rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
# За день
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
# За весь месяц
rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
# Вывод за весь год
rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
# вывод отдельному тегу
rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
# поиск по доп полям
rewrite "^/xfsearch/(.*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
rewrite "^/xfsearch/(.*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
# вывод для отдельного юзера
rewrite "^/user/([^/]*)/rss.xml$" /index.php?mod=rss&subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /index.php?mod=rss&subaction=allnews&user=$1 last;
# вывод всех последних новостей
rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
# вывод в виде каталога
rewrite "^/catalog/([^/]*)/rss.xml$" /index.php?mod=rss&catalog=$1 last;
rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
# вывод непрочитанных статей
rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
# вывод избранных статей
rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
rewrite "^/rules.html$" /index.php?do=rules last;
rewrite "^/statistics.html$" /index.php?do=stats last;
rewrite "^/addnews.html$" /index.php?do=addnews last;
rewrite "^/rss.xml$" /index.php?mod=rss last;
rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
if (!-d $request_filename) {
rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
}
if (!-f $request_filename) {
rewrite "^/([^.]+)/rss.xml$" /index.php?mod=rss&do=cat&category=$1 last;
rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
rewrite "^/print:([^/]+).html$" /index.php?mod=print&do=static&page=$1 last;
}
if (!-f $request_filename) {
rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question