문제

I am trying to serve my app with lighttpd. With seaside 2.8 the following worked in my lighttpd.conf:

proxy.server = ( "/pharo" => (
    ( "host" => "127.0.0.1", "port" => 8080, "check-local" => "disable"))
)

but with seaside 3.0 it rewrites the url to say http://localhost/pharo when accessing it over a network.

Anyone been able to serve pharo and seaside 3 with lighttpd?

도움이 되었습니까?

해결책

The following did work, I uncommented the following line in this method like so:

WARequestHandler>>url
    | url |
    url := self basicUrl.
    self serverPath isNil ifFalse: [ url parsePath: self serverPath ].
    self serverProtocol isNil ifFalse: [ url scheme: self serverProtocol ].
    "self serverHostname isNil ifFalse: [ url host: self serverHostname ]."
    self serverPort isNil ifFalse: [ url port: self serverPort ].

    ^ url

In my seaside configuration of my application all the Server settings (Resource Base Url, Server Hostname, Server Path, Server Port, Server Protocol) are unspecified.

It seems like seaside is trying to get the server settings from some applications parent but i can't chase it.

EDIT: Ok, thanks to Lukas (see comment), all I had to do was reset the #serverHostname in my application configuration found at "Dispatcher: /" to nil (unspecified).

다른 팁

In the seaside config of your app, put your IP address in the Server Hostname field

Looks like lighttpd forwards the original hostname different than Apache does. Put a #halt in WAUrl>>#takeServerParametersFromRequest: and inspect the incoming request aRequest. Presumably there is a header field called X-Forwarded-Host that contains the original host name, if so change the method as follows:

WAUrl>>takeServerParametersFromRequest: aRequest
    "Retrieves scheme, hostname and basepath from the request unless already set."

    scheme isNil
        ifTrue: [ self scheme: aRequest url scheme ].
    host isNil ifTrue: [ 
        aRequest headers at: 'x-forwarded-host' ifPresent: [ :value | self parseAuthority: value  ].
        host isNil 
            ifTrue: [ aRequest headers at: 'host' ifPresent: [ :value | self parseAuthority: value ] ] ].
    path isNil
        ifTrue: [ aRequest headers at: 'base' ifPresent: [ :value | self parsePath: value ] ]

If this (or something similar) solves your problem, please create a ticket.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top