I have an nginx map inside a configuration that looks like this:
map $uri $route {
/route_a /path/to/a.html;
/route_b /path/to/b.html;
}
server {
listen 8080;
server_name example.dev;
}
I tried rewrite inside the server block:
rewrite ^ $route break;
But got a 404 when trying to access /route_a.
I tried location and alias inside the server block:
location ~ ^ {
alias $route
I'm using Nginx and make a small conf file like this :
server {
listen 80;
server_name domain.com;
root /var/www/script;
location /something {
root /var/www/another_script/;
rewrite /something/(.*)$ /index.php?var=$1;
}
}
the problem appear with the rewrite rule which go back to the /var/www/script instead of /var/www/another_script
Can i rewrite to the new root of the
I wanted to include pear/Mail.php.
I asked the hosting support to provide me the path, It is "/usr/local/php-5.3.17/share/pear/".
But it doesn't work from document root, and it seems I can't access upper level directories by using "../".
There are two parent folder for the document root: /home/www/
Still pretty new to nginx here, trying to get a simple rewrite to work, but the server just responds '404 not found'
My server block
server {
listen 80;
listen [::]:80;
server_name pics.example.com;
root /home/pics;
rewrite ^(.*)$ index.php?tag=$1;
location / {
try_files $uri $uri/ $uri.php /index.html $uri =404;
#try_files $uri =404;
fastcgi_split_path_info ^([a-z]+)(/.+)$;
I have a debian server with some git repositories. I've generated two keys using
keygen -t rsa
That gave me root.pub and user.pub files. The root.pub was appended to /root/.ssh/authorized_keys and user.pub to /home/user/.ssh/authorized_keys.
I've converted keys to putty format (ppk): root.ppk and user.ppk.
[root@SERVER ~] ls -la /dev/vg/root
lrwxrwxrwx 1 root root 17 2012-10-28 10:29 /dev/vg/root -> ../mapper/vg-root
[root@SERVER ~]
QUESTION: Why are there symlinks? Why there couldn't be only 1 entry in the /dev for a normal LV in an LVM?? (OS: ubuntu 10.04lts)
I'm migrating some sites from Apache to Nginx and trying to get one configured to answer SSL requests. At the moment I'm getting a server not responding error. If I switch to port 80 I get an nginx error (not worried about the error itself since nginx is at least serving it up).
For this site, I want it to only answer ssl requests.
I've installed java by following this instruction and also had installed java 7 from elsewhere but I can't seem to get it to work..
nginx with php-fpm on ubuntu 12.04 server.
attempting to access /var/www/test.php (via https://example.net/test.php) downloads the script instead of executing it.
if I place the test.php in a subdirectory, i.e. /var/www/test/test.php it executes.
root.conf;
root /var/www;
include php-fpm.conf;
location ~ /\.