My team has a server we use for internal tools and tests. It has a subdomain pointing to it: myserver.mycompany.com
. What we're trying to achieve is to have multiple applications, each with under a sub-directory. I.e.:
myserver.mycompany.com
- generic entry pagemyserver.mycompany.com/redmine
our internal redmine (a ruby on rails server)myserver.mycompany.com/opensocial
a drupal website we are currently testing (a php-fpm application)
I've managed to get redmine to work under the sub-directory but not the drupal website on the sub-directory.
Any suggestions?
Here's a simplified version of my default vhost:
server {
# server name and ssl stuff
root /var/www/html;
## REDMINE
location ~ ^/redmine(/.*|$) {
alias /opt/redmine/public$1;
passenger_base_uri /redmine;
passenger_app_root /opt/redmine;
passenger_document_root /opt/redmine/public;
passenger_enabled on;
}
## END REDMINE
## START Open Social
location ~ ^/opensocial(/.*|$) {
alias /var/www/opensocial/html$1;
index index.php;
location ~ ^/opensocial(/.*|$) {
try_files $uri /index.php?$query_string; # For Drupal >= 7
}
# From nginx's drupal config
location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
# Ensure the php file exists. Mitigates CVE-2019-11043
try_files $fastcgi_script_name =404;
# Security note: If you're running a version of PHP older than the
# latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
# See http://serverfault.com/q/627903/94922 for details.
include fastcgi_params;
# Block httpoxy attacks. See https://httpoxy.org/.
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
fastcgi_intercept_errors on;
# PHP 7 socket location.
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}
## END OF Open Social
Thanks