This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_view(request): | |
... | |
... | |
client_ip = request.META['REMOTE_ADDR'] | |
#or client_ip = request.META['X_FORWARDED_FOR'] | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/nginx/sites-available/mysite.com | |
location / { | |
#add these next two lines | |
fastcgi_param REMOTE_ADDR $remote_addr; | |
fastcgi_param X_FORWADRD_FOR $proxy_add_x_forwarded_for; | |
#this other stuff was here before | |
fastcgi_pass 127.0.0.1:8081; | |
fastcgi_param PATH_INFO $fastcgi_script_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias aws_ssh='/full/path/to/aws_ssh.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ssh -i /full/path/to/key.pem ubuntu@your.ec2.public.dns.com |