SHARE
TWEET

Reverse-Proxy-Server

Zockerjonny Feb 17th, 2020 (edited) 44 in 135 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. > sudo nano etc/exports
  2. ###############################################################
  3.   GNU nano 2.9.3                   /etc/exports                                                                                        
  4. #NFS-Config
  5.  
  6.  
  7. # /etc/exports: the access control list for filesystems which may be exported
  8. #               to NFS clients.  See exports(5).
  9. #
  10. # Example for NFSv2 and NFSv3:
  11. # /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
  12. #
  13. # Example for NFSv4:
  14. # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
  15. # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
  16. #
  17. /etc/letsencrypt IP-OF-REVERSE-PROXY (rw,sync,no_subtree_check)
  18. ###############################################################
  19.  
  20.  
  21. > sudo nano /etc/nginx/sites-available/apache
  22. ###############################################################
  23. #Yes I know misleading .conf name
  24. #NGINX-Reverse-Proxy config
  25.  
  26. server {
  27. listen 80;
  28. listen 443 ssl;
  29.  ssl_certificate /etc/letsencrypt/live/example.net/fullchain.pem;
  30.  ssl_certificate_key /etc/letsencrypt/live/example.net/privkey.pem;
  31.  
  32.  
  33. server_name example.net;
  34. return 301 https://www.example.net;
  35. }
  36.  
  37. server {
  38. listen 80;
  39. server_name www.example.net;
  40. return 301 https://www.example.net;
  41. }
  42.  
  43. server {
  44. listen 443 ssl;
  45. server_name www.example.net 10.10.10.30;
  46.  
  47.  ssl_certificate /etc/letsencrypt/live/example.net/fullchain.pem;
  48.  ssl_certificate_key /etc/letsencrypt/live/example.net/privkey.pem;
  49.  
  50. location / {
  51. root /var/www/html/wartung/;
  52. }
  53. }
  54.  
  55. server {
  56. listen 80;
  57. listen 443;
  58. server_name www.kanboard.example.net;
  59. return 301 https://kanboard.example.net;
  60. }
  61.  
  62.  
  63. server {
  64. listen 80;
  65. listen 443;
  66. server_name kanboard.example.net;
  67. location / {
  68. proxy_pass https://10.10.10.25:443;
  69. # proxy_set_header Host $host;
  70.  proxy_set_header Host $host;
  71.  proxy_set_header X-Real-IP $remote_addr;
  72.  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  73.  proxy_set_header X-Forwarded-Proto https;
  74.  proxy_redirect off;
  75. }
  76. }
  77.  
  78. server {
  79. listen 80;
  80. listen 443;
  81. server_name www.mx.example.net;
  82. return 301 https://mx.example.net;
  83. }
  84.  
  85.  
  86. server {
  87. listen 80;
  88. listen 443;
  89. server_name mx.example.net;
  90. return 301 https://mail.example.net;
  91. }
  92.  
  93. server {
  94. listen 80;
  95. listen 443;
  96. server_name www.mail.example.net;
  97. return 301 https://mail.example.net;
  98. }
  99.  
  100.  server {
  101.  listen 80;
  102.  listen 443;                                        
  103.  server_name mail.example.net;
  104.  
  105.  location / {
  106.  proxy_pass https://10.10.10.26;
  107.  proxy_set_header Host $host;
  108.  proxy_set_header X-Real-IP $remote_addr;
  109.  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  110.  proxy_set_header X-Forwarded-Proto $scheme;
  111.  }
  112.  }
  113. #################################################################
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top