Search code examples
phpnginxvarnishkoken

Koken: Force overwriting the URL


I have a website running Koken. The situation is that I have set up Varnish on port :80 and it redirects everything to Nginx which is on port :8080.

Now I want to make Nginx to write out an error message when somebody tries to access it from outside (on port :8080), cause I want everything to be managed by Varnish first.

The problem:
In Koken you cannot set up a custom url, so all posts on my site redirects to http://foo.com:8080/bar.

Do you know how could I force the url to be a custom url?

Thanks for the answers,
Balint


Solution

  • Try adding this to your nginx.conf:

    port_in_redirect off;
    

    That should keep 8080 out of your URLs. You'll need to clear your Koken system caches (in Settings > System) afterwards to make sure the new URLs are generated.