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

Provide nginx example to run at subdir (example.com/nuget) #16

Open
junalmeida opened this issue Apr 4, 2016 · 2 comments
Open

Provide nginx example to run at subdir (example.com/nuget) #16

junalmeida opened this issue Apr 4, 2016 · 2 comments

Comments

@junalmeida
Copy link

As title.

@Daniel15
Copy link
Owner

You should be able to just add the subdir to all the rewrite rules, and place most of the config in your existing server block. Definitely try it out and let me know if it works :)

@sunsided
Copy link

In my docker image I'm actually using a script to patch the NGINX configuration on the fly based on an environment variable used on docker run:

if [ -z ${BASE_URL+false} ]
then
    echo "Using base URL: /"
else
    CONFIGFILE=/etc/nginx/conf.d/nuget.conf
    echo "Using base URL: $BASE_URL"
    perl -pi -e "s#rewrite \^(?!$BASE_URL)/#rewrite ^$BASE_URL/#g" $CONFIGFILE
    perl -pi -e "s#location = (?!$BASE_URL)/#location = $BASE_URL/#g" $CONFIGFILE
fi

It basically patchesnginx.conf from

rewrite ^/$ /index.php;

to

rewrite ^/some-configurable-path$ /index.php;

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

No branches or pull requests

3 participants