server
{
listen serverip:80;
server_name community.myproject.com www.community.myproject.com;
access_log /var/log/nginx/domains/community.myproject.com.log;
access_log /var/log/nginx/domains/community.myproject.com.bytes bytes;
error_log /var/log/nginx/domains/community.myproject.com.error.log;
root "/home/myopen/domains/community.myproject.com/public_html";
index index.php index.html index.htm;
if ($http_x_forwarded_proto != 'https') {
return 301 https://$host$request_uri;
}
# Mail auto configuration (Thunderbird)
location = "/.well-known/autoconfig/mail/config-v1.1.xml" {
proxy_pass http://unix:/usr/local/directadmin/shared/internal.sock;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
}
location /
{
# access_log off;
proxy_buffering off;
proxy_pass http://serverip:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header Upgrade;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias "/home/myopen/domains/community.myproject.com/public_html/";
internal;
}
location /knowledgebase
{
proxy_buffering off;
proxy_pass http://serverip:5001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Client-IP $remote_addr;
proxy_hide_header Upgrade;
}
include /etc/nginx/webapps.conf;
}
server
{
listen serverip:443 ssl;
http2 on;
server_name community.myproject.com www.community.myproject.com;
access_log /var/log/nginx/domains/community.myproject.com.log;
access_log /var/log/nginx/domains/community.myproject.com.bytes bytes;
error_log /var/log/nginx/domains/community.myproject.com.error.log;
root "/home/myopen/domains/community.myproject.com/private_html";
index index.php index.html index.htm;
ssl_certificate /usr/local/directadmin/data/users/myopen/domains/community.myproject.com.cert.combined;
ssl_certificate_key /usr/local/directadmin/data/users/myopen/domains/community.myproject.com.key;
# Mail auto configuration (Thunderbird)
location = "/.well-known/autoconfig/mail/config-v1.1.xml" {
proxy_pass http://unix:/usr/local/directadmin/shared/internal.sock;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
}
location /
{
# access_log off;
proxy_buffering off;
proxy_pass https://serverip:8081;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header Upgrade;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias "/home/myopen/domains/community.myproject.com/private_html/";
internal;
}
location /knowledgebase
{
proxy_buffering off;
proxy_pass http://serverip:5001;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Client-IP $remote_addr;
proxy_hide_header Upgrade;
}
include /etc/nginx/webapps.ssl.conf;
}