使用 lighttpd 服务 pharo seaside 3.0

发布于 2024-10-12 21:19:43 字数 392 浏览 7 评论 0原文

我正在尝试使用lighttpd 为我的应用程序提供服务。在seaside 2.8中,以下内容在我的lighttpd.conf中起作用:

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

但在seaside 3.0中,它重写了url以表示http://localhost/pharo 通过网络访问时。

有人能够用lighttpd 为pharo 和seaside 3 提供服务吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

金橙橙 2024-10-19 21:19:43

以下内容确实有效,我在此方法中取消注释了以下行,如下所示:

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

在我的应用程序的海边配置中,所有服务器设置(资源库 URL、服务器主机名、服务器路径、服务器端口、服务器协议)均未指定。

似乎海边正在尝试从某些应用程序父级获取服务器设置,但我无法追赶它。

编辑:好的,感谢 Lukas(请参阅评论),我所要做的就是将“Dispatcher:/”中找到的应用程序配置中的 #serverHostname 重置为 nil (未指定)。

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).

够运 2024-10-19 21:19:43

在应用程序的 Seaside 配置中,将您的 IP 地址放入“服务器主机名”字段中

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

思念满溢 2024-10-19 21:19:43

看起来 lighttpd 转发的原始主机名与 Apache 不同。将 #halt 放入 WAUrl>>#takeServerParametersFromRequest: 中并检查传入请求 aRequest。大概有一个名为 X-Forwarded-Host 的标头字段包含原始主机名,如果是这样,请按如下方式更改方法:

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 ] ]

如果此(或类似的内容)解决了您的问题,请 创建票证

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文