NHold

32

Oct 20th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.99 KB | None | 0 0
  1. # Default server configuration
  2. #
  3. server {
  4.         listen 80 default_server;
  5.         listen [::]:80 default_server;
  6.  
  7.         # SSL configuration
  8.        #
  9.        # listen 443 ssl default_server;
  10.        # listen [::]:443 ssl default_server;
  11.        #
  12.        # Note: You should disable gzip for SSL traffic.
  13.        # See: https://bugs.debian.org/773332
  14.        #
  15.        # Read up on ssl_ciphers to ensure a secure configuration.
  16.        # See: https://bugs.debian.org/765782
  17.        #
  18.        # Self signed certs generated by the ssl-cert package
  19.        # Don't use them in a production server!
  20.        #
  21.        # include snippets/snakeoil.conf;
  22.  
  23.         root /var/www/html;
  24.  
  25.         # Add index.php to the list if you are using PHP
  26.        index index.html index.htm index.nginx-debian.html index.php;
  27.  
  28.         server_name _;
  29.  
  30. location /api {
  31.   rewrite ^(.*)$ /api.php;
  32. }
  33.  
  34. location ~ \.html {
  35.   if (!-e $request_filename){
  36.     rewrite ^(.*)$ /nf.php;
  37.   }
  38. }
  39.  
  40.         # pass PHP scripts to FastCGI server
  41.        #
  42.        location ~ [^/]\.php(/|$) {
  43.                 include snippets/fastcgi-php.conf;
  44.         #
  45.        #       # With php-fpm (or other unix sockets):
  46.                fastcgi_pass unix:/run/php/php7.3-fpm.sock;
  47.         #       # With php-cgi (or other tcp sockets):
  48.        #       fastcgi_pass 127.0.0.1:9000;
  49.                fastcgi_read_timeout 300;
  50.         }
  51.  
  52.         # deny access to .htaccess files, if Apache's document root
  53.        # concurs with nginx's one
  54.        #
  55.        location ~ /\.ht {
  56.                 deny all;
  57.         }
  58. }
  59.  
  60.  
  61. # Virtual Host configuration for example.com
  62. #
  63. # You can move that to a different file under sites-available/ and symlink that
  64. # to sites-enabled/ to enable it.
  65. #
  66. #server {
  67. #       listen 80;
  68. #       listen [::]:80;
  69. #
  70. #       server_name example.com;
  71. #
  72. #       root /var/www/example.com;
  73. #       index index.html;
  74. #
  75. #       location / {
  76. #               try_files $uri $uri/ =404;
  77. #       }
  78. #}
Add Comment
Please, Sign In to add comment