In my Pylons config file, I have:

[server:main1]
port = 9090
...config here...

[server:main2]
port = 9091
...config here...

Which are ran using:

paster serve --server-name=main1 ...(more stuff)...
paster serve --server-name=main2 ...(more stuff)...

Now, using Haproxy and Stunnel, I have all http requests going to main1 and all https requests going to main2. I would like some of my controllers to react a little differently based on if they are being requested under http or https but pylons.request.scheme always thinks that it is under http even when it is not.

Seeing as I always know that main2 is always the one handling all https requests, is there a way for the controller to determine what sever name it was ran under or what id it is?

有帮助吗?

解决方案

I got around this by just changing the workflow to not have to react differently based on what protocol it's under. It doesn't look like there's a way to pass a unique arbitrary identifier to each separate process that it can read.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top