Join the community today
Register Now

nginx conf for YOURLS url shortener

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by paddy, Mar 29, 2015.

  1. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    7:47 AM
    1.7.7
    MariaDB 5.5
    hi , good day!


    how to add YOURLS rewrite rules to nginx conf ?
    i've tried several method and still no luck.

    Code:
    server {
      server_name domain.tld www.domain.tld;
    
    # ngx_pagespeed & ngx_pagespeed handler
    include /usr/local/nginx/conf/pagespeed.conf;
    include /usr/local/nginx/conf/pagespeedhandler.conf;
    include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      access_log /home/nginx/domains/domain.tld/log/access.log combined buffer=32k;
      error_log /home/nginx/domains/domain.tld/log/error.log;
    
      root /home/nginx/domains/domain.tld/public;
    
    location / {
    #try_files $uri $uri/ /yourls-loader.php;
    }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
    }
    
    so far i use conf like above , and what i get is 403 forbidden.
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    not sure i understand what you want to do ? please elaborate with examples :)
     
  3. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    7:47 AM
    1.7.7
    MariaDB 5.5
    hi
    sorry if i didnt explain it well .
    im using YOURLS url shortener, and the problem is i have to make a new rewrite rule to adapt with nginx conf.

    Code:
    try_files $uri $uri/ /yourls-loader.php;
    
    the code above was i use for the rewrite rule, but somehow dont know why but it doesnt work .

    here is my domain.conf

    Code:
    server {
      server_name domain.com domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    include /usr/local/nginx/conf/pagespeed.conf;
    include /usr/local/nginx/conf/pagespeedhandler.conf;
    include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=32k;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      root /home/nginx/domains/domain.com/public;
    
    location / {
    try_files $uri $uri/ /yourls-loader.php;
    }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
    }
    
    i hope this time i can explain well ,:D
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    7:47 AM
    1.7.7
    MariaDB 5.5
    ok eva200 thanks for the answer , i think i'll try to search again with google.
     
  6. trxerz

    trxerz Member

    69
    5
    8
    Jun 25, 2015
    Ratings:
    +7
    Local Time:
    1:47 AM
    I've try it and no luck with yourls nginx setup tutorial over the net.
    What about your installation? Is it working?