0

To start off I have zero experience with web servers.

I have a simple web app running with nodejs on a aws lightsail instance. I also want to host a WordPress with a different domain on that same server, the two have nothing to do with each other.

Is what I want to do possible? I tried to just install WordPress and php on the server following this guide but it ended up causing the node app to break. My config file looked like this:

server {
    listen 80;

    server_name domain.com;

    location / {
        proxy_pass http://172.26.4.71:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

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

        server_name your_domain.com;

        location / {
                # try_files $uri $uri/ =404;
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}
  • What do you mean by "break"? You need to provide specific errors. – Michael Hampton Jun 13 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.