PHP support for sockets (vs TCP) improved
This commit is contained in:
parent
a1f73d883a
commit
6fadf0c631
|
@ -205,7 +205,7 @@ class PHPController(WebAppServiceMixin, ServiceController):
|
|||
context['fpm_listen'] = webapp.type_instance.FPM_LISTEN % context
|
||||
fpm_config = Template(textwrap.dedent("""\
|
||||
;; {{ banner }}
|
||||
[{{ user }}]
|
||||
[{{ user }}-{{app_id}}]
|
||||
user = {{ user }}
|
||||
group = {{ group }}
|
||||
|
||||
|
|
|
@ -227,15 +227,16 @@ class Apache2Controller(ServiceController):
|
|||
target = 'fcgi://%(socket)s%(app_path)s/$1'
|
||||
else:
|
||||
# UNIX socket
|
||||
target = 'unix:%(socket)s|fcgi://127.0.0.1%(app_path)s/'
|
||||
if context['location']:
|
||||
# FIXME unix sockets do not support $1
|
||||
target = 'unix:%(socket)s|fcgi://127.0.0.1%(app_path)s/$1'
|
||||
target = 'unix:%(socket)s|fcgi://127.0.0.1/'
|
||||
context.update({
|
||||
'app_path': os.path.normpath(app_path),
|
||||
'socket': socket,
|
||||
})
|
||||
directives = "ProxyPassMatch ^%(location)s/(.*\.php(/.*)?)$ {target}\n".format(target=target) % context
|
||||
directives = textwrap.dedent("""
|
||||
<FilesMatch "\.php$">
|
||||
SetHandler "proxy:unix:{socket}|fcgi://127.0.0.1"
|
||||
</FilesMatch>
|
||||
""").format(socket=socket)
|
||||
directives += self.get_location_filesystem_map(context)
|
||||
return [
|
||||
(context['location'], directives),
|
||||
|
|
Loading…
Reference in New Issue