Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 8:01 pm by JMSDOnline
Apr 13, 2016 8:01 pm by JMSDOnline
Just purchased the Startup package in an attempt to observer how much better the paid-for packages work against the free.
I have the folllowing nginx rules:
rewrite "^/([a-z]{2}|en|es)/([a-z]{2}|en|es)/(.*)$" /$1/$3 permanent;
rewrite "^/([a-z]{2}|en|es)/([a-z]{2}|en|es)$" /$1/ permanent;
rewrite "^/([a-z]{2}|en|es)/(.*)$" /gtranslate/translat
Site can be seen here: http://valleyweddingpages.com/es/
404 Not found, additionally... the folder has been uploaded to the site root and permissions are set properly.
What else would I need to do?
As I stated.. I am using nginx and have added the above rules to my sites .conf and reloaded the web server. Still no joy
Look forward to some support on this issue.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 8:08 pm by Edvard
Apr 13, 2016 8:08 pm by Edvard
Hi,
Your rewrite rules are incomplete and will give you errors if you try to reload/restart nginx.
You can try this rules instead:
rewrite "^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$" /$1/$3 permanent;
rewrite "^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$" /gtranslate/gtranslate.php?glang=$1&gurl=$2 last;
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 8:10 pm by JMSDOnline
Apr 13, 2016 8:10 pm by JMSDOnline
Interesting, thanks for the additional rules, however; I was able to restart/reload nginx without issue. I am only assuming the use of two languages... en and es.. are all these other includes really needed.. as it stands, this looks just like the rewrites I already use, just with more unnecessary fluff.
=======
I tried your included rules... I am still receiving a 404
http://valleyweddingpages.com/es/
I really am having a hard time understanding the differences here:
PREVIOUS RULES ---
#rewrite "^/([a-z]{2}|en|es)/([a-z]{2}|en|es)/(.*)$" /$1/$3 permanent;
#rewrite "^/([a-z]{2}|en|es)/([a-z]{2}|en|es)$" /$1/ permanent;
#rewrite "^/([a-z]{2}|en|es)/(.*)$" /gtranslate/translate.php?lang=$1&url=$2 last;
#rewrite "^/([a-z]{2}|en|es)$" /gtranslate/translate.php?lang=$1 last;
NEW RULES ---
rewrite "^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$" /$1/$3 permanent;
rewrite "^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$" /gtranslate/gtranslate.php?glang=$1&gurl=$2 last;
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 8:11 pm by Edvard
Apr 13, 2016 8:11 pm by Edvard
It is not possible since this rule has syntax errors:
rewrite "^/([a-z]{2}|en|es)/(.*)$" /gtranslate/translat
May be you have sent incomplete rules.
Thanks!
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 8:16 pm by JMSDOnline
Apr 13, 2016 8:16 pm by JMSDOnline
Indeed, apologies. I pasted in an incomplete set of rules from my config.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 8:26 pm by Edvard
Apr 13, 2016 8:26 pm by Edvard
You can use only the languages you want in the rewrite rules
For example
rewrite "^(en|es)/(en|es)/(.*)$" /$1/$3 permanent;
rewrite "^(en|es)/(.*)$" /gtranslate/gtranslate.php?glang=$1&gurl=$2 last;
Where do you put them? May be you can post more context from your configuration?
Thanks!
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 10:05 pm by JMSDOnline
Apr 13, 2016 10:05 pm by JMSDOnline
Sure thing, this is what I had adjusted my config to. I am reviewing logs but they are not giving any insight to the 404 issues.
server {
listen *:80;
listen [::]:80;
listen *:443 ssl http2;
listen [::]:443 ssl http2;
include vstacklet/directive-only/ssl.conf;
ssl_certificate /srv/www/valleyweddingpages/ssl/valleyweddingpages_com.crt;
ssl_certificate_key /srv/www/valleyweddingpages/ssl/valleyweddingpages_com.key;
server_name valleyweddingpages.com;
set $no_cache 0;
if ($query_string) {
set $no_cache 1;
}
if ($http_x_custom_header) {
set $no_cache 0;
}
if ($uri ~ "/administrator/") {
set $no_cache 1;
}
if ($uri ~ "/monthly-giveaways/") {
set $no_cache 1;
}
if ($uri ~ "/contact") {
set $no_cache 1;
}
if ($http_cookie ~ "users_login_cookie") {
set $no_cache 1;
}
access_log /srv/www/valleyweddingpages/logs/valleyweddingpages_access.log;
error_log /srv/www/valleyweddingpages/logs/valleyweddingpages_error.log;
root /srv/www/valleyweddingpages/public;
index index.html index.htm index.php;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_cache phpcache;
fastcgi_cache_methods GET HEAD;
add_header X-Fastcgi-Cache $upstream_cache_status;
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache_valid 200 302 60m;
fastcgi_cache_valid 404 5m;
fastcgi_read_timeout 300;
fastcgi_ignore_headers X-Accel-Expires Expires Cache-Control;
add_header X-XSS-Protection "1; mode=block";
add_header X-Delivery-Via "JMSoloDesigns.com";
}
location /administrator/ {
set $no_cache 1;
}
if ($uri ~ "/magazine-archives/winter-2016-magazine") {
rewrite ^(.*) https://magazine.valleyweddingpages.com permanent;
}
if ($uri ~ "/magazine-archives/2016-annual-planning-guide") {
rewrite ^(.*) https://planning-guide.valleyweddingpages.com permanent;
}
if ($uri ~ "/magazine-archives/2015-annual-planning-guide") {
rewrite ^(.*) https://planning-guide-2015.valleyweddingpages.com permanent;
}
rewrite "^(en|es)/(en|es)/(.*)$" /$1/$3 permanent;
rewrite "^(en|es)/(.*)$" /gtranslate/gtranslate.php?glang=$1&gurl=$2 last;
location ~ /.well-known {
allow all;
}
# Location Functions
include vstacklet/location/cache-busting.conf;
include vstacklet/location/cross-domain-fonts.conf;
include vstacklet/location/expires.conf;
include vstacklet/location/protect-system-files.conf;
include vstacklet/location/pma.conf;
# Website Specific Hardened Config
include /srv/www/valleyweddingpages/public/nginx.conf;
}
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 10:48 pm by Edvard
Apr 13, 2016 10:48 pm by Edvard
OK, move it up before location and use this instead:
rewrite "^/(en|es)/(en|es)/(.*)$" /$1/$3 permanent;
rewrite "^/(en|es)/(.*)$" /gtranslate/gtranslate.php?glang=$1&gurl=$2 last;
I have noticed that you have subscribed to our Startup, however you have SSL on your website. You will need to use our Enterprise plan for SSL support.
Thanks!
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:28 pm by JMSDOnline
Apr 13, 2016 11:28 pm by JMSDOnline
Whom would I contact to receive a refund?
The client does not want to drop their SSL as they are not inclined to pay the monthly fee in regards to simply being able to use an SSL. Additionally, I use letsencrypt to generate SSL certificates for them and then forward the SSL through Cloudflare to secure their site. Dropping security in favor of translation is simply not a solution they are after, and again, the price isn't very aggressive... please do not take me out of context, I love the module, and all work should go rewarded... but I have to agree with them on this.
Actually, I will out-of-pocket this one. Consider that payment a donation towards your free version. I will cancel the subscription via PayPal.
Thanks for your effort on this... it just isn't a good fit.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:43 pm by Edvard
Apr 13, 2016 11:43 pm by Edvard
Hi,
You can use your PayPal to ask for a refund.
Enterprise version is not only about SSL support, it gives you more translation traffic and more features like URL Translation.
Thanks!
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:48 pm by JMSDOnline
Apr 13, 2016 11:48 pm by JMSDOnline
Would we be able to use letsencypt certificates generated on the server?
Also, they use Cloudflare as their DNS and push all SSL traffic through them. SSL is also used to cache nginx on port 443 as well as render actual user IPs.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:49 pm by Edvard
Apr 13, 2016 11:49 pm by Edvard
Yes! It is not about certificates, it is about websites which use SSL.
It is fine with Cloudflare, you can let me know your real IP address and we will do a special configuration for you, to not cause the reverse proxy traffic to travel back and forth, cloudflare doesn't like that.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:50 pm by JMSDOnline
Apr 13, 2016 11:50 pm by JMSDOnline
Let me confirm... I thought I had read in your docs that we needed to submit a wildcard SSL in order to take advantage of the SSL deliverable within the Enterprise package. So, any certificate is ok to produce for a particular cname within the DNS.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:51 pm by Edvard
Apr 13, 2016 11:51 pm by Edvard
If you use sub-directory structure no need for wildcard certificates.
If you want to use sub-domain URL structure in combination with cloudflare free SSL, it will also work. We just need to know what exactly you want.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:54 pm by JMSDOnline
Apr 13, 2016 11:54 pm by JMSDOnline
If this is all ok, then consider them sold. I am on the line with them to sort this out. Hopefully that does work as they will comply as long as we do not have to fork out any additional (i.e; certificate) costs as the methods I have produced for them have been great up to this point... but I know they need translation... the url translation bit is not needed, but that comes later.
Again, thanks for your time dealing with me.
Perfect! (in response to your last comment) they want to keep a sub-directory structure at any rate.
This will not cause DNS issues between the IP listed at Cloudflare and your 94.... ip will it. Even though it's whitelisted... I am not too certain CloudFlare will accept forwarding the traffic... but I supoose I could find a solution around the HSTS restrictions.
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 13, 2016 11:59 pm by Edvard
Apr 13, 2016 11:59 pm by Edvard
It works little bit tricky with Cloudflare and sub-directory structure. We will be getting your original content for translations directly from your server bypassing Cloudflare, we just need to know your server IP address. All the traffic to your website will go through Cloudflare. Only the requests from our server to get your original content will go to your server directly.
You just need to have our Enterprise plan, no need to overpay for additional certificates, etc...
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 14, 2016 12:24 am by JMSDOnline
Apr 14, 2016 12:24 am by JMSDOnline
Very cool! That makes perfect sense.
I'll confirm all of this with the client and return for an Enterprise plan tomorrow. Is there an email I can add to my contact list for communications once I have them on the Enterprise package?
Also, how would I go about upgrading to the Enterprise from the Starter package... or do I need to dull out the additional costs?
Re: Nginx Settings - GTranslate Startup Package throws a 404
Apr 14, 2016 12:27 am by Edvard
Apr 14, 2016 12:27 am by Edvard
You can use [email protected]
The steps are the same. You just need to subscribe.
Re: Nginx Settings - GTranslate Startup Package throws a 404
May 3, 2016 11:19 am by piercebody
May 3, 2016 11:19 am by piercebody
I am your enterprise customer. Now I have decided to move gtranslated files my subdomains into subdirectory.
Can you please provide me the redirect script for Nginx for redirecting all my subdomains to subdirectory.
i.e redirect de.XXXX.com to XXXX.com/de ( 301 permanent redirect).
Please advise. Thanks.
SIMILAR TOPICS
Gtranslate Multisite | Feb 12, 2019 7:27 am | Replies: 1 | Post by: infact_dat |
Gtranslate: Error with number | Feb 20, 2019 1:20 am | Replies: 1 | Post by: infact_dat |
GTranslate 3.7.4, Joomla 3.9.3 - doGTranslate is not defined | Feb 22, 2019 12:34 pm | Replies: 1 | Post by: oase |
Add-on gtranslate no longer works | Feb 2, 2019 6:01 am | Replies: 1 | Post by: DarylDixon |
Nginx 502 Error | Jan 11, 2019 2:15 pm | Replies: 1 | Post by: mightyfineprint |