Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can u recreate nodejs test example with nginx? #434

Open
johnfelipe opened this issue Jun 6, 2022 · 6 comments
Open

Can u recreate nodejs test example with nginx? #434

johnfelipe opened this issue Jun 6, 2022 · 6 comments

Comments

@johnfelipe
Copy link

No description provided.

@johnfelipe
Copy link
Author

Anyone
Pls help ASAP

@johnfelipe
Copy link
Author

hello me again, pls tell me how to use nodejs feature with oneinstack, with a test or simple example

@oneinstack
Copy link
Owner

recreate nodejs vhost:

./vhost.sh --del
./vhost.sh --proxy

@johnfelipe
Copy link
Author

My real question is how put 127.0.0.1:300 webapp with nodejs into example.com, im lost, sorry for rookie question

@oneinstack
Copy link
Owner

oneinstack commented Jun 12, 2022

[root@localhost ~]# /root/oneinstack/vhost.sh --proxy

#######################################################################
#       OneinStack for CentOS/RedHat 7+ Debian 8+ and Ubuntu 16+      #
#       For more information please visit https://oneinstack.com      #
#######################################################################

What Are You Doing?
        1. Use HTTP Only
        2. Use your own SSL Certificate and Key
        3. Use Let's Encrypt to Create SSL Certificate and Key
        q. Exit
Please input the correct option: 1

Please input domain(example: www.example.com): example.com
domain=example.com

Do you want to add more domain name? [y/n]: n

Do you want to add hotlink protection? [y/n]: n

Please input the correct proxy_pass: http://127.0.0.1:3000
proxy_pass=http://127.0.0.1:3000

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......

#######################################################################
#       OneinStack for CentOS/RedHat 7+ Debian 8+ and Ubuntu 16+      #
#       For more information please visit https://oneinstack.com      #
#######################################################################
Your domain:                  example.com
Virtualhost conf:             /usr/local/nginx/conf/vhost/example.com.conf
[root@localhost ~]# cat /usr/local/nginx/conf/vhost/example.com.conf
server {
  listen 80;
  listen [::]:80;
  server_name example.com;
  
  index index.html index.htm index.php;
  
  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_max_temp_file_size 0;
  }

  #error_page 404 /404.html;
  #error_page 502 /502.html;
  

  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    expires 30d;
    access_log off;
  }
  location ~ .*\.(js|css)?$ {
    expires 7d;
    access_log off;
  }
  location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
    deny all;
  }
  location /.well-known {
    allow all;
  }
}

@johnfelipe
Copy link
Author

johnfelipe commented Jun 12, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants