Nginx and EasyEngine wpsite


#1

Hi community! :slight_smile:

Im not really familiar with all this stuff, so if you guys could help that would be awesome. I succesfully installed a wp site on mydomain.com, but after installing nginx to configure nodebb forum at forum.mydomain.com, now mydomain.com also shows a forum. The wpsite is gone.

I dont know what happened, could anyone clarify this? I followed this guide: lhttps://docs.nodebb.org/en/latest/configuring/proxies/nginx.html

Thanks so much.

cd /etc/nginx/ && ls

common htpasswd-ee nginx.conf sites-enabled conf.d koi-utf proxy_params snippets fastcgi.conf koi-win scgi_params uwsgi_params fastcgi_params mime.types sites-available win-utf

cd sites-enabled && ls

22222 forum.mydomain.com

nano 22222

# EasyEngine admin NGINX CONFIGURATION

server {

  listen 22222 default_server ssl http2;

  access_log   /var/log/nginx/22222.access.log rt_cache;
  error_log    /var/log/nginx/22222.error.log;

  ssl_certificate /var/www/22222/cert/22222.crt;
  ssl_certificate_key /var/www/22222/cert/22222.key;

  # Force HTTP to HTTPS
  error_page 497 =200 https://$host:22222$request_uri;

  root /var/www/22222/htdocs;
  index index.php index.htm index.html;

  # Turn on directory listing
  autoindex on;

  # HTTP Authentication on port 22222
  include common/acl.conf;

  location / {
    try_files $uri $uri/ /index.php?$args;
  }

  # Display menu at location /fpm/status/
  location =  /fpm/status/ {}

  location ~ /fpm/status/(.*) {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param  SCRIPT_NAME  /status;
    fastcgi_pass $1;
  }

  location ~ \.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_pass php;

# ViMbAdmin Rules
  location = /vimbadmin/ {
    return 301 $scheme://$host:22222/vimbadmin/public/;
  }

  location ~* \.(js|css|jpg|gif|png)$ {
    root /var/www/22222/htdocs/;
  }

  location ~* /vimbadmin/public/(.*)/(.*) {
    root /var/www/22222/htdocs/vimbadmin/public;
    try_files $uri $uri/  /vimbadmin/public/index.php?$args;
  }

  location ~* /vimbadmin/public/(.*) {
    root /var/www/22222/htdocs/vimbadmin/public;
    try_files $uri $uri/  /vimbadmin/public/index.php?$args;
  }

}

nano forum.mydomain.com

server {
listen 80;

server_name forum.mydomain.com;

location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass http://127.0.0.1:4567/;
    proxy_redirect off;

    # Socket.IO Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}
}

nano nginx.conf

user www-data;
worker_processes 1;
worker_rlimit_nofile 100000;
pid /run/nginx.pid;

events {
        worker_connections 1024;
        multi_accept on;
}

http {
        ##
        # EasyEngine Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 30;
        types_hash_max_size 2048;

        server_tokens off;
        reset_timedout_connection on;
        add_header X-Powered-By "EasyEngine 3.7.2";
        add_header rt-Fastcgi-Cache $upstream_cache_status;

        # Limit Request
        limit_req_status 403;
        limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

        # Proxy Settings
        # set_real_ip_from      proxy-server-ip;
        # real_ip_header        X-Forwarded-For;

        fastcgi_read_timeout 300;
        client_max_body_size 100m;

        ##
        # SSL Settings
        ##

        ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
        ssl_prefer_server_ciphers on;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:E$
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

        ##
        # Basic Settings
        ##
        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        # Log format Settings
log_format rt_cache '$remote_addr $upstream_response_time $upstream_cac$
        '$http_host "$request" $status $body_bytes_sent '
        '"$http_referer" "$http_user_agent"';

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types
            application/atom+xml
            application/javascript
            application/json
            application/rss+xml
            application/vnd.ms-fontobject
 application/x-font-ttf
            application/x-web-app-manifest+json
            application/xhtml+xml
            application/xml
            font/opentype
            image/svg+xml
            image/x-icon
            text/css
            text/plain
            text/x-component
            text/xml
            text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}
#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

#2

Do you mean you have install nginx after using easyengine ? because ee install nginx to run wp and you can use it to create another vhost with php and mysql for nodebb. no need to install anything else than ee


#3

Hi! Thank you for your answers. So, ee installs nginx itself? How do I use it to configure nodebb to be used on forum.mydomain.com? How do I create this vhost with php and mysql? A link to a guide or an explanation of what to after installing ee and nodebb would be much, much appreciated. Also, nodebb works with mongodb, so I installed that one too.

I indeed did install nginx after I installed ee and a wp site. I thought that was needed to make nodebb run at forum.mydomain.com instead of a local server with a port.

Thank you so much! Much appreciated.


#4

You will find all your info here : https://easyengine.io/docs/commands/site/create/ You can create different type of website with ee and it will also create mysql or use the php version of your choice.

EE will not install mongodb so you can do it yourself, but for nginx, php and mysql EE can do it.


#5