I’m trying to run yii under a web subdirectory, rather than as a domain in itself, i.e. instead of yiiapp.example.net, it should be example.net/yiiapp. Intent is to be able to serve multiple applications (rails as well as yii) from the same website, just using subdirectories to differentiate the apps.
I can get yii to run with the default nginx config documented in www.yiiframework.com/doc/guide/1.1/en/quickstart.apache-nginx-config. So with that now working, I tried a basic alias, i.e. instead of:
location / {
...
}
I changed it to:
location /yiiapp {
alias /var/www/yiiframework/htdocs/$1;
...
}
the pages load and work, but I lose the stylesheets, images etc, which leads me to believe the alias is also affecting other parts of the path; this means either the web browser client cannot find the right paths to the resources, and/or I need more rewrite rules in the nginx configuration for this server.
I’ve tried following several examples that I managed to google, none are specific to yii but in more in general to just nginx. Some suggest alias as I’ve already done, others have more complicated rewrite rules which I’m not sure how they work.
Anybody have any suggestions or a working configuration that I could use? Thanks in advance.
(This is my first post, I can’t embed links so had to remove all the http references… so apologies!)