It is possible, but I would suggest to use different sub-domains and a ngnix config file for each application, like I did for my own project :
- www.leave-management-system.org
- demo.leave-management-system.org
- influxdb.leave-management-system.org
- etc.
The advantage is that you can disable one application without impacting the others and that the configuration is easier to maintain when it comes in different files.
Anyway, you need to (follow the links):
However, if you don't want to use sub-domains, but two different folder on the same domain, a combined configuration could look like this one :
server {
listen 80 default;
server_name www.example.com;
...
location /otherinternalpage/ {
try_files $uri $uri/ /index.php?/$request_uri;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
#This is a Linux socket config
#fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
#Alternatively, you can configure nginx/PHP with a backend
fastcgi_pass 127.0.0.1:{YOUR_PORT};
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
}
location / {
proxy_pass http://localhost:{YOUR_PORT};
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;
}
}