Nginx Settings - GTranslate Startup Package throws a 404

Popular automatic website translation tool

Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 12:01 am

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.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 12:08 am

Hi,

Your rewrite rules are incomplete and will give you errors if you try to reload/restart nginx.

You can try this rules instead:

Code: Select all
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;
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 12:10 am

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;
Last edited by JMSDOnline on Thu Apr 14, 2016 12:15 am, edited 1 time in total.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 12:11 am

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!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 12:16 am

Indeed, apologies. I pasted in an incomplete set of rules from my config.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 12:26 am

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!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 2:05 am

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.


Code: Select all
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;

}
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 2:48 am

OK, move it up before location and use this instead:

Code: Select all
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!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 3:28 am

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.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 3:43 am

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!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 3:48 am

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.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 3:49 am

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.
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 3:50 am

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.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 3:51 am

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.
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 3:54 am

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.
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 3:59 am

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...
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby JMSDOnline » Thu Apr 14, 2016 4:24 am

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?
JMSDOnline
 
Posts: 9
Joined: Wed Apr 13, 2016 11:59 pm

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby Edvard » Thu Apr 14, 2016 4:27 am

You can use [email protected]

The steps are the same. You just need to subscribe.
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Nginx Settings - GTranslate Startup Package throws a 404

Postby piercebody » Tue May 03, 2016 3:19 pm

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.
piercebody
 
Posts: 5
Joined: Thu Oct 17, 2013 7:20 am


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests