I tried |?proxy_redirect=off| and it worked - has not fixed the issue. To be fair though, I only restarted httpd service at cli level, is there something else I need to do?
Kind regards
Hi, I know it's been a little while, a 1-year-old thread but I'm having the same issue and wondering if you found the solution?
I am very new to all of these... Usually, we develop using WordPress or PHP but now we started using nodeJS which requires deploying apps and running a node server on a port. So instead of only nginx we switched to apache_nginx because there are many accounts that still need .htaccess files. Apparently only using apache for Node isn't recommended. It was quite hard to get it to work because almost all tutorials out there are made for centos, apache, or Nginx on a non-shared server without an admin panel.
So, finally figured out that we need to use those "tokens" to make changes to nginx_apache configuration files. Our app is running on port 3000 and forwarding 8080 to 3000 works. But not secure. Forwarding 8081 to 3000 we get a bad gateway even though the app server is running (however, the site looks secure, as SSL is active).
With custom code, nginx.conf file for thaicitizen.org file looks like this:
Code:
# Auto generated nginx config file by DirectAdmin version 1.641
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to their website
# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
server
{
listen 103.13.231.113:80;
server_name thaicitizen.org www.thaicitizen.org ;
access_log /var/log/nginx/domains/thaicitizen.org.log;
access_log /var/log/nginx/domains/thaicitizen.org.bytes bytes;
error_log /var/log/nginx/domains/thaicitizen.org.error.log;
root /home/thaicitize/domains/thaicitizen.org/public_html;
index index.php index.html index.htm;
include /usr/local/directadmin/data/users/thaicitize/nginx_php.conf;
location /
{
# access_log off;
proxy_buffering off;
proxy_pass http://thaicitizen.org:3000;
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/thaicitize/domains/thaicitizen.org/public_html/;
internal;
}
include /etc/nginx/webapps.conf;
}
server
{
listen 103.13.231.113:443 ssl http2;
server_name thaicitizen.org www.thaicitizen.org ;
access_log /var/log/nginx/domains/thaicitizen.org.log;
access_log /var/log/nginx/domains/thaicitizen.org.bytes bytes;
error_log /var/log/nginx/domains/thaicitizen.org.error.log;
root /home/thaicitize/domains/thaicitizen.org/private_html;
index index.php index.html index.htm;
ssl_certificate /usr/local/directadmin/data/users/thaicitize/domains/thaicitizen.org.cert.combined;
ssl_certificate_key /usr/local/directadmin/data/users/thaicitize/domains/thaicitizen.org.key;
include /usr/local/directadmin/data/users/thaicitize/nginx_php.conf;
location /
{
# access_log off;
proxy_buffering off;
proxy_pass https://thaicitizen.org:3000;
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/thaicitize/domains/thaicitizen.org/private_html/;
internal;
}
include /etc/nginx/webapps.ssl.conf;
}
There are also these templates there you can see, but I'm not sure if I should be editing those and how?
I deployed some sample code to a domain we don't use to take some screenshots, have a look, please. What am I doing wrong here? Thanks in advance...