Home

Archives

Bio

Github

Whatsapp

Reverse IP

9:51 AM
* sudo apt-get update
* sudo apt install nginx -y
* mkdir -p /etc/nginx/cert
* mkdir -p /var/www/html/.well-known/pki-validation

// repeat ::
-> ke zeroSSL untuk bikin ip dahulu
	- masukkin ip , ambil auth file nya
	- masukkin auth file yang telah di download di folder
	/var/www/html/.well-known/pki-validation
	- verifikasi auth file.
	- tunggu sampai jadi certificate nya
	

-> masukkan certificate nya certificate.crt + ca_bundle.crt kedalam cert.crt
	- masukkin ke dalam folder /etc/nginx/cert
	- masukkin private.key kedalam folder /etc/nginx/cert

// bikin file web.conf untuk di baca nginx
* sudo nano /etc/nginx/sites-enabled/default
	- buang semua isi dalam default.
	- ganti dengan yang dibawah ini :
	
server {
        listen 80 ;
		location /.well-known/pki-validation/ {
			root /var/www/html ;
		}
		location / {
			return 301 https://$host$request_uri;
		}
}

limit_req_zone $binary_remote_addr zone=mylimit:400m rate=5r/s;
server{
        listen 443 ssl ;
        server_name  <ip_address> ;

        ssl_certificate         /etc/nginx/cert/cert.crt ;
        ssl_certificate_key     /etc/nginx/cert/private.key ;
		
        access_log /var/log/nginx/ip-access.log;
        error_log /var/log/nginx/ip-error.log;
		location /.well-known/pki-validation/ {
			root /var/www/html ;
		}
		
		location / {
			limit_req zone=mylimit burst=20 nodelay ;
			add_header 'Access-Control-Allow-Origin' '*' always;
			proxy_set_header        X-Forwarded-Server      $host ;
			proxy_set_header        X-Forwarded-Host        $host ;
			proxy_set_header        X-Forwarded-For         $proxy_add_x_forwarded_for;
			proxy_hide_header		server ;
			proxy_cookie_domain 	<domain_name>			$host ;
			proxy_pass 				<url_source> ;
			proxy_ssl_server_name on;
        
		}
}

-----------------------------------------------------------------------------------------------
(*) <ip_address>		ip address punya vps
(*) <domain_name>		nama domain dari source nya contoh :	resepso.com
(*) <url_source>		full url source nya contoh : https://resepso.com


untuk perpanjang certificate, ikutin naik ke repeat::

* sudo nginx -t
	untuk mengecek nginx error
	
* sudo service nginx restart
	untuk restart effect nginx

nano of course can delete blocks, see this article

  1. use CTRL+Shift+6 to mark the beginning of your block
  2. move cursor with arrow keys to end of your block, the text will be highlighted.
  3. use CTRL+K to cut/delete block.

To paste the block to another place, move cursor to the position and the use CTRL+U. You can paste the block as often as you want to.

© 2014 Hendra All Right Reserved