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
|
context['fpm_listen'] = webapp.type_instance.FPM_LISTEN % context
|
||||||
fpm_config = Template(textwrap.dedent("""\
|
fpm_config = Template(textwrap.dedent("""\
|
||||||
;; {{ banner }}
|
;; {{ banner }}
|
||||||
[{{ user }}]
|
[{{ user }}-{{app_id}}]
|
||||||
user = {{ user }}
|
user = {{ user }}
|
||||||
group = {{ group }}
|
group = {{ group }}
|
||||||
|
|
||||||
|
|
|
@ -227,15 +227,16 @@ class Apache2Controller(ServiceController):
|
||||||
target = 'fcgi://%(socket)s%(app_path)s/$1'
|
target = 'fcgi://%(socket)s%(app_path)s/$1'
|
||||||
else:
|
else:
|
||||||
# UNIX socket
|
# UNIX socket
|
||||||
target = 'unix:%(socket)s|fcgi://127.0.0.1%(app_path)s/'
|
target = 'unix:%(socket)s|fcgi://127.0.0.1/'
|
||||||
if context['location']:
|
|
||||||
# FIXME unix sockets do not support $1
|
|
||||||
target = 'unix:%(socket)s|fcgi://127.0.0.1%(app_path)s/$1'
|
|
||||||
context.update({
|
context.update({
|
||||||
'app_path': os.path.normpath(app_path),
|
'app_path': os.path.normpath(app_path),
|
||||||
'socket': socket,
|
'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)
|
directives += self.get_location_filesystem_map(context)
|
||||||
return [
|
return [
|
||||||
(context['location'], directives),
|
(context['location'], directives),
|
||||||
|
|
Loading…
Reference in a new issue