server {
listen 443 ssl http2;
server_name am-log.com;
access_log "/var/log/httpd/am-log_ssl-access.log" combined;
error_log "/var/log/httpd/am-log_ssl-error.log" warn;
ssl_certificate /etc/httpd/cert/mass/am-log.com.crt;
ssl_certificate_key /etc/httpd/cert/mass/am-log.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!MD5;
# Define the vhost to serve files
root "/shared/httpd/am-log/htdocs/public";
index index.php index.html index.htm;
# PHP-FPM Definition
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php?$ {
try_files $uri = 404;
include fastcgi_params;
# https://stackoverflow.com/questions/1733306/nginx-errors-readv-and-recv-failed/51457613#51457613
fastcgi_keep_conn off;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 172.16.238.10:9000;
fastcgi_read_timeout 180;
fastcgi_index index.php;
fastcgi_intercept_errors on;
}
# Alias Definition
location ~ /devilbox-api/ {
root /var/www/default/api;
# Allow cross domain request from these hosts
# https://fetch.spec.whatwg.org/#forbidden-header-name
if ( $http_origin ~* (http(s)?://(.*)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
add_header "Access-Control-Allow-Methods' 'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS";
add_header "Access-Control-Allow-Headers' 'Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With";
add_header "Access-Control-Expose-Headers' 'Content-Security-Policy, Location";
add_header "Access-Control-Max-Age" 0;
return 200;
}
}
# Deny Definition
location ~ /\.git {
deny all;
}
# Deny Definition
location ~ /\.ht.* {
deny all;
}
# Custom directives
}
server {
listen 80;
server_name am-log.com;
access_log "/var/log/httpd/am-log-access.log" combined;
error_log "/var/log/httpd/am-log-error.log" warn;
# Define the vhost to serve files
root "/shared/httpd/am-log/htdocs/public";
index index.php index.html index.htm;
# PHP-FPM Definition
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php?$ {
try_files $uri = 404;
include fastcgi_params;
# https://stackoverflow.com/questions/1733306/nginx-errors-readv-and-recv-failed/51457613#51457613
fastcgi_keep_conn off;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 172.16.238.10:9000;
fastcgi_read_timeout 180;
fastcgi_index index.php;
fastcgi_intercept_errors on;
}
# Alias Definition
location ~ /devilbox-api/ {
root /var/www/default/api;
# Allow cross domain request from these hosts
# https://fetch.spec.whatwg.org/#forbidden-header-name
if ( $http_origin ~* (http(s)?://(.*)$) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
add_header "Access-Control-Allow-Methods' 'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS";
add_header "Access-Control-Allow-Headers' 'Accept, Authorization, Content-Security-Policy, Content-Type, Location, Origin, X-Requested-With";
add_header "Access-Control-Expose-Headers' 'Content-Security-Policy, Location";
add_header "Access-Control-Max-Age" 0;
return 200;
}
}
# Deny Definition
location ~ /\.git {
deny all;
}
# Deny Definition
location ~ /\.ht.* {
deny all;
}
# Custom directives
}