Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx support #21

Closed
xurizaemon opened this issue Apr 25, 2015 · 3 comments · Fixed by #47
Closed

Nginx support #21

xurizaemon opened this issue Apr 25, 2015 · 3 comments · Fixed by #47

Comments

@xurizaemon
Copy link

I was getting 500s on front page - the following change makes NginX behave better for me.

Also provides NginX with a deny rule for sites/default/files/civicrm

xurizaemon added a commit to xurizaemon/amp that referenced this issue Apr 25, 2015
@totten totten closed this as completed Apr 25, 2015
@totten totten reopened this Apr 25, 2015
@totten
Copy link
Collaborator

totten commented Apr 25, 2015

Hmm.... that's a Drupal URL pattern... the problem is that every amp aims for a lower level in the stack (where it can support Drupal/Joomla/WordPress/Symfony/etc). But the nginx vhost has to vary depending on the CMS. I think the process needs to be more like this:

## Create a new app with nginx support
mkdir myapp
git init myapp
mkdir .amp
vi .amp/nginx-template.php
git add .amp/nginxtemplate.php
git push

git clone myapp.git
cd myapp
amp create
## ^^^ checks for .amp/nginx-template.php

The file ".amp/nginx-template.php" would be different for each CMS>

@xurizaemon
Copy link
Author

Totally agree, that could be improved & also take in account the site directory this site was deployed to (sites/default doesn't account for multisite).

OTOH, no harm done if we block access to those locations for each CMS in AMP ... so I might go for a lazy resub of this with sites/*/files/civicrm and the equivalent other-CMS paths until there's a need to be real specific.

@xurizaemon
Copy link
Author

Keeping notes on what I have to do for new nginx spin-ups.

  • add index index.php; to server entries

totten added a commit that referenced this issue Jul 25, 2017
…#21)

For example, suppose we've configured the `httpd` as `nginx`:
 * If the env has variable `NGINX_VHOST_TPL`, use that.
 * If the web-root or any parent has `.amp/nginx-vhost.php`, use that.
 * Otherwise, use the default template specified in `amp`.
totten added a commit that referenced this issue Aug 8, 2017
…#21)

For example, suppose we've configured the `httpd` as `nginx`:
 * If the env has variable `NGINX_VHOST_TPL`, use that.
 * If the web-root or any parent has `.amp/nginx-vhost.php`, use that.
 * Otherwise, use the default template specified in `amp`.
@totten totten closed this as completed in #47 Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants