%PDF- %PDF-
| Direktori : /etc/nginx/ea-nginx/ |
| Current File : //etc/nginx/ea-nginx/default.conf.tt |
server {
listen 80[% IF reuseport %] reuseport[% END %];
[% IF !ipv6 %]# server does not have IPv6 enabled: [% END %]listen [::]:80[% IF reuseport %] reuseport[% END %];
# We want SSL for this server so http:// and https:// work the same for these server_name’s
listen 443 ssl[% IF reuseport %] reuseport[% END %];
[% IF !ipv6 %]# server does not have IPv6 enabled: [% END %]listen [::]:443 ssl[% IF reuseport %] reuseport[% END %];
http2 [% http2 ? "on" : "off" %];
ssl_certificate [% ssl_certificate %];
ssl_certificate_key [% ssl_certificate_key %];
# $hostname because we do not want the machine's hostname to be treated as a service subdomain
# (e.g. $hostname is cpanel.example.com)
# 127.0.0.1 and localhost so that those are handled consistently like $hostname
server_name 127.0.0.1 localhost $hostname;
location / {
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://$CPANEL_APACHE_PROXY_IP:$CPANEL_APACHE_PROXY_PORT;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
[%- IF uid %]
set $USER_ID "";
[% END -%]
include conf.d/server-includes/*.conf;
}
[% IF webshield_enabled %]
server {
server_name 127.0.0.1 localhost $hostname;
[%- FOREACH item IN webshield_ports %]
listen [% item.nginx %][% IF item.is_ssl && ssl_certificate && ssl_certificate_key %] ssl[% END %][% IF reuseport %] reuseport[% END %];
[% IF ipv6 %]listen [::]:[% item.nginx %][% IF item.is_ssl && ssl_certificate && ssl_certificate_key %] ssl[% END %][% IF reuseport %] reuseport[% END %];[% END %]
[% END -%]
[%- IF ssl_certificate && ssl_certificate_key %]
http2 [% http2 ? "on" : "off" %];
ssl_protocols TLSv1.2 TLSv1.3;
proxy_ssl_protocols TLSv1.2 TLSv1.3;
ssl_certificate [% ssl_certificate %];
ssl_certificate_key [% ssl_certificate_key %];
[%- END %]
location / {
expires off;
proxy_http_version 1.1;
proxy_bind $cpanel_bind_target;
set $backend_dest $server_addr;
if ($backend_dest ~ "^[a-fA-F0-9:]+$") {
set $backend_dest [$backend_dest];
}
proxy_pass $scheme://$backend_dest:$cpanel_dst_port;
proxy_set_header Connection $conn_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Remote-IP $remote_addr;
proxy_pass_header Server;
}
}
[% END %]