0

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

balintant
  • 2,774
  • 1
  • 19
  • 33
  • the purpose to redirect port 80 to 8080 is to block in firewall to outside to access port 8080 directly. So if someone access your website via port 8080, it shouldn't give any content, and show as 404. But you should be still fine to access via port 8080 internally. – BMW Jul 28 '14 at 06:05
  • @BMW My goal is that, but the links generated by [Koken](http://koken.me), will content the port `:8080`, so the user would get errors, when they open any link from the webpage. – balintant Jul 28 '14 at 09:01

1 Answers1

0

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.

Brad Daily
  • 792
  • 8
  • 14