I have a bunch of small sinatra apps, and now I have to publish them under SSL HTTP as well.
I have https://secure.mydomain.com/ and I want to publish those apps in subdirectories:
/app1
/app2
I followed Phusion Passenger instructions here to publish in subdirs, but inside each application '/' points to root directory.
I don't want to change the code of all apps because, they are already working in non-ssl environment.
What do I need to change to make my application's '/' point to app's root, and not parent's root?
Looks like you just need the url helper method:
url '/' # => https://secure.mydomain.com/app1/
Related
My server was built on Apache and Nginx.
There are some directories with js scripts Node on root directory web site.
Via url address i can call direct file such like: domen.com/node/notific.js
How as it can be blocked?
I saw apache tutorial and found that it possible set in apache2.conf, to specify here in the Servername part param index-options, but it acts only on the prohibition directories.
And what you advice check me for more security my directories?
Thanks
Still fairly new to NGINX.
I have a wordpress site which will be the root site, and a rails app which should be in a subdirectory (site.com/portal). I previously had this working with Passenger, but wanted to check out Puma (looking for zero downtime deploy).
I have another rails app working fine on Puma, and my wordpress site is working too. But I can't seem to get my portal app to show up underneath my wordpress app. Before, with passenger, I symlinked the portal app inside the wordpress site and added some passenger directives to Nginx.
# Use rails app inside wordpress
location /portal {
rails_env development;
passenger_min_instances 2;
passenger_enabled on;
passenger_base_uri /portal;
}
I tried changing this to use root:
# With symlinked /var/www/portal/public -> /var/www/website/public/portal
location /portal {
root /var/www/portal/public;
}
But no matter what I do I either get forbidden or not found errors.
Everything I've found is for passenger, or a wordpress site inside the rails app. How can I use Puma, and put my rails app inside a wordpress site?
Here are my complete nginx configs for the two sites:
nginx/conf/sites-enabled/local.website.conf
nginx/conf/sites-enabled/ssl.local.portal.conf
Recently I developed a Sinatra app that running under Thin.
On my local and test servers it runs ok, but when I add it to my production env, all resources from public dir is inaccessible.
I'm not a apache guy, so I'm a little lost here.
Here is what I did:
httpd.conf
...
ProxyPass /myapp/ http://127.0.0.1:9194/myapp
ProxyPassReverse /myapp/ http://127.0.0.1:9194/myapp
By doing this, I want that every request to mydomain.com/myapp/ be forward to myapp.
In my app dir a have a public directory, with all my css, js and image files.
So, when I point to http://mydomain.com/myapp/ the html comes, but no css, images and js.
On the other hand, if I point to 127.0.0.1 at port 9194 it works as it should.
So my question is, how can I configure my apache - or thin, or sinatra - so I can have access to my public content via ProxyPass?
Thanks.
Add a / at the end of the second argument for ProxyPassReverse. The Apache docs say that if the first argument has a trailing slash, the second one also should have one.
I have a zend project located in the /account sub folder. I want to be able to create sub-domain virtual hosts and point their DocumentRoot to this sub folder
In index.php I have this line that sets the URL of the zend project folder
define('SiteUrlUser','http://'.$_SERVER['HTTP_HOST'].'/account/');
The DocumentRoot setup for one sub-domain is
DocumentRoot /var/www/account
As i'm browsing the site at subomdain.domain.com it always adds /account to the URLs which is normal but then throws this error
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (account)'
Now if I remove /account from any URL while accessing the site through a subdomain the pages render just fine. So basically www.domain.com/account/something.html in a subdomain would be subdomain.domain.com/something.html which is working perfectly fine.
I'm planning to setup the server so that all users will login through their sub-domain. The zend folder will be put on it's own server and used as the DocumentRoot for all sub-domains so what would I change in the index.php to make this work?
Thanks
I wouldnt nest the project inside another non-zend project, i would give it its own root out side the web accessible dir of the other project and point the subdomain there. Then just make your module/controller for account the default via routing.
However if you do nest them then you will have to set the baseUrl
If the parent project is also a zend app then i would merge the two together and use routing to handle the sub-dir mapping this way you can do a wildcard vhost and point them all to the same application instance on the filesystem.
I just installed a Rails 3 application on a development server, and it can be loaded by using http://server:3000/
In our production setup, all applications are proxied by apache running on another server. All applications are to be accessed by http://prodserver/appX . CSS and javascripts need to be loaded when using apache proxy.
How do I revise routes.rb and change rails.root to use appX, without changing the application?
Use the ProxyPassReverse configuration command in Apache and it will rewrite URL's so you don't have to change anything in routes.rb