- Affected App
- WoltLab Suite Blog
So I seem to get a 404 not found when adding a trailing slash.
/blog/ = 404
/blog = Good
https://sociallyuncensored.com/blog = good
https://sociallyuncensored.com/blog/ = 404
This is the nginx rules
So I seem to get a 404 not found when adding a trailing slash.
/blog/ = 404
/blog = Good
https://sociallyuncensored.com/blog = good
https://sociallyuncensored.com/blog/ = 404
This is the nginx rules
Your RegEx force the usage of a Slash at the end.
Without a Slash the Location wont be used and nginx uses its default.
Your RegEx force the usage of a Slash at the end.Without a Slash the Location wont be used and nginx uses its default.
I'm using the code you provided here
The full nginx rewrite rules for ALL Woltlab Products
What is that needs to be changed? I don't see any flaw in the code.
No you don't use the code provided by me.
Where exactly do you see a location pattern like your one ?
No you don't use the code provided by me.
I assume you updated it after I copied it down
Where exactly do you see a location pattern like your one ?
I have applied the changes and they work.
Thanks
I'll never had anything postet like the one you postet here (and also didn't edited my post).
I think you copied it anywhere else
I'll never had anything postet like the one you postet here (and also didn't edited my post).
I think you copied it anywhere else
Well your code didn't solve it either... Now the 404 is backwards
/blogs = 404
/blogs / - good
https://sociallyuncensored.com/blog = 404
https://sociallyuncensored.com/blog/ = good
The following should work for both cases:
Works with
/blog/
Does not work with
/blog
So we're back to post #1
edit: Also made thread links invalid.
So enabling both wasn't good.
So disabled the other.
location / {
add_header Access-Control-Allow-Origin "*";
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(wcf/|faq/|blog/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
#rewrite ^/((wcf|faq|blog|gallery|filebase|wbb|chat)/?)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
}
Display More
The FULL config is this...
I've obviously removed my true ip addresses
server {
listen XXXXXXXXXXXXXXX; # listen for IPv4
listen XXXXXXXXXXXXXXXXXXX; # listen for IPv6
# Cloudflare
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
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 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/12;
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;
real_ip_header CF-Connecting-IP;
server_name www.sociallyuncensored.com sociallyuncensored.com;
return 301 https://sociallyuncensored.com$request_uri;
}
server {
listen XXXXXXXXXXXXXXXXXXX ssl spdy; # IP v4
listen XXXXXXXXXXXXXXXXXXX ssl spdy; # IP v6
# Cloudflare
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
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 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/12;
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;
real_ip_header CF-Connecting-IP;
server_name sociallyuncensored.com;
keepalive_timeout 70;
ssl_certificate /usr/share/nginx/comodo_ssl/com/ssl-unified.crt;
ssl_certificate_key /usr/share/nginx/comodo_ssl/com/sociallyuncensored.com.key;
ssl_trusted_certificate /usr/share/nginx/comodo_ssl/com/ssl-trusted.crt;
include /etc/nginx/ssl.conf;
#charset koi8-r;
access_log /var/log/nginx/log/sociallyuncensored.com.log main;
error_log /var/log/nginx/log/sociallyuncensored.com.error.log;
root /usr/share/nginx/sociallyuncensored.com/public_html;
index index.html index.htm index.php;
include /etc/nginx/rewrites.conf;
include /etc/nginx/staticfiles.conf;
include /etc/nginx/php.conf;
location / {
add_header Access-Control-Allow-Origin "*";
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
rewrite ^/twitter(.*)$ https://twitter.com/oldschooldsl$1 permanent;
rewrite ^/plus(.*)$ https://plus.google.com/103337399563740578273$1 permanent;
rewrite ^/googleplus(.*)$ https://plus.google.com/103337399563740578273$1 permanent;
rewrite ^/google(.*)$ https://plus.google.com/103337399563740578273$1 permanent;
rewrite ^/facebook(.*)$ https://www.facebook.com/pages/Socially-Uncensored/116857488368279$1 permanent;
rewrite ^/amazon(.*)$ http://www.amazon.com/registry/wishlist/19TZQ5QWZOZID/?_encoding=UTF8&camp=1789&creative=390957&linkCode=ur2&tag=socialuncens-20$1 permanent;
}
location @rewrite {
rewrite ^/(wcf/|faq/|blog/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
#rewrite ^/((wcf|faq|blog|gallery|filebase|wbb|chat)/?)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
}
}
Display More
Point of reference for current paths
have you reloaded nginx after config change ?
and which nginx version do you use ?
because using my config works on both link types on my server.
The Reason is simple:
You installed the Blog to your root directory so sociallyuncensored.com/ is the correct Link
So you have to remove the blog entry from the rewrite roules:
rewrite ^/(wcf/|faq/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
this should work
have you reloaded nginx after config change ?
Yes, of course. For argument sake, I even reloaded php (I know its not needed, but it doesn't hurt)
service php5-fpm restart
service nginx restart
and which nginx version do you use ?
The only one that matters
nginx version: nginx/1.7.12
The Reason is simple:
You installed the Blog to your root directory so sociallyuncensored.com/ is the correct Link
So you have to remove the blog entry from the rewrite roules:
rewrite ^/(wcf/|faq/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
this should work
It works without blog added, but it did not solve the issue
https://sociallyuncensored.com/blog = 404
https://sociallyuncensored.com/blog/ = GOOD
Someone asked me what is here?
include /etc/nginx/rewrites.conf;
include /etc/nginx/staticfiles.conf;
include /etc/nginx/php.conf
Alright...
rewrites.conf
staticfiles.conf
location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
gzip_static off;
#add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
expires 30d;
break;
}
location ~* \.(js)$ {
#add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
expires 30d;
break;
}
location ~* \.(css)$ {
#add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
expires 30d;
break;
}
location ~* \.(html|htm|txt)$ {
#add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
expires 1d;
break;
}
location ~* \.(eot|svg|ttf|woff)$ {
#add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
expires 30d;
break;
}
Display More
php.conf
location ~ \.php$ {
#try_files $uri =404;
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#try_files $fastcgi_script_name =404;
if (!-e $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_read_timeout 600;
}
Display More
Well, try this one:
rewrite ^/(wcf/|faq/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)(/[^/]+)?/?$ /$1index.php?$2/$3 last;
this makes the ending slash optional
Well, try this one:rewrite ^/(wcf/|faq/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)(/[^/]+)?/?$ /$1index.php?$2/$3 last;this makes the ending slash optional
Fixed blogs.... However made all forum links invalid.
maybe you should simply add a single rewrite roule for the blog only.
rewrite ^/blog(.*)$ /index.php?blog$1 last;
Should work...
maybe you should simply add a single rewrite roule for the blog only.
rewrite ^/blog(.*)$ /index.php?blog$1 last;
Should work...
WINNER !!!!
This is what I'm using now
location / {
add_header Access-Control-Allow-Origin "*";
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/blog(.*)$ /index.php?blog$1 last;
rewrite ^/(wcf/|faq/|gallery/|filebase/|wbb/|chat/)?([a-zA-Z0-9\-]+)/([^/]+)?/?$ /$1index.php?$2/$3 last;
}
Display More
And for the future, I already said that to you:
Please do not post multiple posts after each other! Edit your previous post of nobody has already answered.
And for the future, I already said that to you:
Please do not post multiple posts after each other! Edit your previous post of nobody has already answered.
That's an odd request, but something I'll try to keep in mind. On most of the communities that I visit, including my own, it is frown upon to edit something later as often it is abused.
Further it isn't intuitive or helpful... If I read your post and 1/2 hour from now you edit it to include something you forgot... I'm not going to notice you edited it or get any notice that you did and so I'm not going to get that new bit of important information.
Then you should first think about what you want to write so that you don’t need to edit your posts. Unfortunately, nearly every thread of you has at least one double post. So maybe you should overthink your doing.
Further more, multi-posts are simply unwanted.
Don’t have an account yet? Register yourself now and be a part of our community!