Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- eg_vhost.com snippet:
- # OPTIONAL: Running the translator behind a proxy requires accessing
- # the client IP address via mod_remoteip (sudo a2enmod remoteip).
- # Below is a sample configuration for a proxy running on the same
- # server and passing the client IP address via the X-Real-IP header.
- #
- RemoteIPInternalProxy 127.0.0.1/24
- RemoteIPInternalProxy ::1
- RemoteIPHeader X-Real-IP
- osrf-ws-http-proxy:
- # File /etc/nginx/sites-available/osrf-ws-http-proxy
- #
- # $ ln -s /etc/nginx/sites-available/osrf-ws-http-proxy \
- # /etc/nginx/sites-enabled/osrf-ws-http-proxy
- # $ sudo service nginx restart
- #
- # Assumes Apache is listening on HTTP=7080 and HTTPS=7443
- server {
- listen 80;
- location / {
- proxy_pass http://127.0.0.1:7080;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_read_timeout 180s;
- }
- }
- server {
- listen 443;
- ssl on;
- # Use the same SSL certificate as Apache.
- ssl_certificate /etc/apache2/ssl/server.crt;
- ssl_certificate_key /etc/apache2/ssl/server.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # omit SSLv3 because of POODLE
- ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
- ssl_prefer_server_ciphers on;
- ssl_dhparam /etc/apache2/ssl/dhparams.pem;
- location / {
- proxy_pass https://127.0.0.1:7443;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_read_timeout 180s;
- }
- location /osrf-websocket-translator {
- proxy_pass http://127.0.0.1:7682;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # Needed for websockets proxying.
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- # Raise the default nginx proxy timeout values to an arbitrarily
- # high value so that we can leverage osrf-websocket-translator's
- # timeout settings.
- proxy_connect_timeout 5m;
- proxy_send_timeout 5m;
- proxy_read_timeout 5m;
- }
- }
- rpaf.conf:
- <IfModule rpaf_module>
- RPAFenable On
- # When enabled, take the incoming X-Host header and
- # update the virtualhost settings accordingly:
- RPAFsethostname On
- # Define which IP's are your frontend proxies that sends
- # the correct X-Forwarded-For headers:
- RPAFproxy_ips 127.0.0.1 ::1
- # Change the header name to parse from the default
- # X-Forwarded-For to something of your choice:
- RPAFheader X-Real-IP
- </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement