PHP support for sockets (vs TCP) improved

This commit is contained in:
Marc Aymerich 2017-07-05 17:52:37 +00:00
parent a1f73d883a
commit 6fadf0c631
2 changed files with 7 additions and 6 deletions

View File

@ -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 }}

View File

@ -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),