Nginx location “not equal to” regex

According to nginx documentation there is no syntax for NOT matching a regular expression. Instead, match the target regular expression and assign an empty block, then use location / to match anything else So you could define something like location ~ (dir1|file2\.php) { # empty } location / { rewrite ^/(.*) http://example.com/$1 permanent; }

how to configuring a xampp web server for different root directory

You can change Apaches httpd.conf by clicking (in xampp control panel) apache/conf/httpd.conf and adjust the entries for DocumentRoot and the corresponding Directory entry. Just Ctrl+F for “htdocs” and change the entries to your new path. See screenshot: # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests … Read more

Avoid public folder of laravel and open directly the root in web server

Let’s assume you have this folder structure in your server .cpanel/ public_html/ public_ftp/ .. And the laravel folder structure is app/ bootstrap/ public/ vendor/ composer.json artisan .. You can create a folder name mylaravelsite on your server inline with public_html and public_ftp folder, and copy to it the whole laravel application except the public folder … Read more

Configure nginx with multiple locations with different root folders on subdomain

You need to use the alias directive for location /static: server { index index.html; server_name test.example.com; root /web/test.example.com/www; location /static/ { alias /web/test.example.com/static/; } } The nginx wiki explains the difference between root and alias better than I can: Note that it may look similar to the root directive at first sight, but the document … Read more

Non socket based Java Server [closed]

You need sockets. They serve as the end-points to the connection. Although, you can use alternatives to the blocking Socket and ServerSocket implementations. NIO (New IO) uses channels. It allows for non-blocking I/O: class Server { public static void main(String[] args) throws Exception { ServerSocketChannel ssc = ServerSocketChannel.open(); ssc.configureBlocking(false); while(true) { SocketChannel sc = ssc.accept(); … Read more