I run my app on nodejs for server side into port 8000 and for the client react port 3000 and iam using sql for db then i install phpmyadmin but when i
location /api {
proxy_pass http://localhost:8000;
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;
}
location /{
proxy_pass http://localhost: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;
in /etc/nginx/sites-available file
and
location ~ \.php$ {
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
}
This site can’t be reached that what i get in the browser
i am using ubuntu 20.04 and nginx
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @ahmadabulielnet,
Try using the following location configuration for your Reverse Proxy:
Save the file and enable this new virtual host by creating a symbolic link:
Test the configuration to ensure there are no errors:
If there are no errors, reload Nginx:
Regards, KFSys