1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

(ASK) Setting ByREV WP-PICShield di Nginx

Discussion in 'Hosting & Domain' started by emha_xp, Dec 28, 2014.

  1. emha_xp

    emha_xp Super Hero

    Joined:
    Jul 14, 2010
    Messages:
    808
    Likes Received:
    177
    Location:
    Dunia Lain
    Malam bro
    numpang tanya setingan ByREV WP-PICShield menngunakan nginx, ane uda coba tapi g jalan2 bro.

    thanks bantuannya bro


    :)
     
  2. hardinalz

    hardinalz Super Hero

    Joined:
    Mar 8, 2010
    Messages:
    2,395
    Likes Received:
    1,420
    Location:
    /var/www/html
    Pake panel apa tanpa panel? Kalo tanpa panel tinggal tambah di vhost nginx nya aja. Nunggu jawaban dulu, nanti saya lanjutin.
     
  3. emha_xp

    emha_xp Super Hero

    Joined:
    Jul 14, 2010
    Messages:
    808
    Likes Received:
    177
    Location:
    Dunia Lain
    thanks mas har, vps tanpa panel mas, nginx+mariadb.
     
  4. hardinalz

    hardinalz Super Hero

    Joined:
    Mar 8, 2010
    Messages:
    2,395
    Likes Received:
    1,420
    Location:
    /var/www/html
    ^^

    Tambahkan kode ini ke vhost nginx, misal lokasi vhost nginx untuk domain example.com berada di

    /etc/nginx/sites-available/example.com

    maka tambahkan kode berikut di paling bawah, tepat sebelum sebelum tanda "}"

    vi /etc/nginx/sites-available/example.com

    Kodenya adalah

    PHP:
    #Begin By-REV WP-PicShield settings
    if ($uri ~* ".(jpg|jpeg|png|gif)$"){
    set $rule_0 1$rule_0;
    }
    if (
    $remote_addr !~* "^(127.0.0.1|12.34.56.78)$"){
    set $rule_0 2$rule_0;
    }
    if (
    $remote_addr !~* "^66.6.(32|33|36|44|45|46|40)."){
    set $rule_0 3$rule_0;
    }
    if (
    $http_referer !~* "^http(s)?://(www.)?(example.com|translate.google.com|translate.googleusercontent.com|www.microsofttranslator.com|pinterest.com|tumblr.com|facebook.com|plus.google|twitter.com|googleapis.com|googleusercontent.com|ytimg.com|gstatic.com)"){
    set $rule_0 4$rule_0;
    }
    if (
    $http_user_agent !~* "(googlebot|msnbot|baiduspider|slurp|webcrawler|teoma|photon|facebookexternalhit|facebookplatform|pinterest|feedfetcher|ggpht)"){
    set $rule_0 5$rule_0;
    }
    if (
    $http_user_agent !~* "(photon|smush.it|akamai|cloudfront|netdna|bitgravity|maxcdn|edgecast|limelight|tineye)"){
    set $rule_0 6$rule_0;
    }
    if (
    $http_user_agent !~* "(developers|gstatic|googleapis|googleusercontent|google|ytimg)"){
    set $rule_0 7$rule_0;
    }
    if (
    $rule_0 "7654321"){
    rewrite /(.*) /byrev-wp-picshield.php?key=abcdefghi&src=$1 last;
    }
    #End By-REV WP_PicShield setting
    Note: Sesuaikan 3 kode berikut:
    example.com --> domain agan
    12.34.56.78 --> IP VPS
    abcdefghi --> kode unik dari plugin (cek di Dashboard WP)

    Kalo sudah silahkan reload nginx, kalo di keluarga Debian/Ubuntuk bisa dengan perintah:

    service nginx reload
     
    herika and rbdhewa like this.
  5. emha_xp

    emha_xp Super Hero

    Joined:
    Jul 14, 2010
    Messages:
    808
    Likes Received:
    177
    Location:
    Dunia Lain
    Thanks bnyk nih mas :)
     
  6. chop2

    chop2 Ads.id Fan

    Joined:
    Mar 8, 2015
    Messages:
    163
    Likes Received:
    1
    mas itu kode unik dimana?
     
  7. personalblog

    personalblog Ads.id Starter

    Joined:
    Mar 21, 2012
    Messages:
    69
    Likes Received:
    0
    Location:
    Yogyakarta
    kalau websitenya lebih dari 1 bagaimana ya. soalnya dimasukkin yang satu jadi yang lain eror. makasih
     
  8. showcheap

    showcheap Ads.id Starter

    Joined:
    Feb 14, 2012
    Messages:
    62
    Likes Received:
    2
    Location:
    Ngawi
    Untuk ngetes konfigurasi nginx, pakai perintah

    Code:
    nginx -t
    Nanti kelihatan errornya dibaris berapa, sebelum menerapkan perubahan konfigurasi.
     
  9. Ahmad Sarnuji

    Ahmad Sarnuji Super Hero

    Joined:
    May 30, 2015
    Messages:
    1,918
    Likes Received:
    201
    Location:
    Kab.Tangerang, Desa Sumur Bandung
    simak gan ilmu kayaknya :D
     

Share This Page