#1192 Unloading mod_http where http_host is used by many VirtualHosts
Reporter
Zash
Owner
Nobody
Created
Updated
Stars
★ (1)
Tags
Priority-Medium
Type-Defect
Status-Accepted
Zash
on
What steps will reproduce the problem?
Two or more hosts with the same `http_host`.
``` config
VirtualHost "a"
VirtualHost "b"
http_host = "a"
```
Unload mod_http from one host.
``` console
module:load("http") -- loaded on all first
module:unload("http", "b")
```
HTTP request to something on host 'a'.
What is the expected output?
Should work.
What do you see instead?
404, unknown host
Please provide any additional information below.
When mod_http, a global/shared module, is loaded on two hosts with the same http_host it registers the `http_host` name twice. If it is unloaded from one host, it unregisters the name despite it being used by other, still enabled, hosts.
Zash
on
Zash: Could we perhaps move the host awareness out of net.http.server?
MattJ: Hmm, that sounds pretty sensible
What steps will reproduce the problem? Two or more hosts with the same `http_host`. ``` config VirtualHost "a" VirtualHost "b" http_host = "a" ``` Unload mod_http from one host. ``` console module:load("http") -- loaded on all first module:unload("http", "b") ``` HTTP request to something on host 'a'. What is the expected output? Should work. What do you see instead? 404, unknown host Please provide any additional information below. When mod_http, a global/shared module, is loaded on two hosts with the same http_host it registers the `http_host` name twice. If it is unloaded from one host, it unregisters the name despite it being used by other, still enabled, hosts.
Zash: Could we perhaps move the host awareness out of net.http.server? MattJ: Hmm, that sounds pretty sensible