<commit_before>nginxify
========

Nginxify parses JSON configurations of NGINX config files and creates the appropriate representations in configuration.

## Usage

#### Static

Static site path config has a string path relative to your home folder.

#### Proxy Pass

Proxy pass to a port with an integer port number as the path config.

#### PHP

PHP using [PHP-FPM](http://php-fpm.org/) is supported with the path config `["php", "path/to/project"]`.

#### SimplifiedPHP

[SimplifiedPHP](https://github.com/NateFerrero/simplified-php) using [PHP-FPM](http://php-fpm.org/) is supported with the path config `["sphp", "path/to/project"]`.

Create a file called `.nginx` in your home directory (/home/username), and populate according to the following JSON:

```js
{
  "my.domain.com": {
    "paths": {
      "/": "my_domain", // this is a directory relative to your home directory,
      "/testapp": 3000  // This will proxy all requests to a server running on port 3000
    }
  },
  "other.domain.com": {
    "paths": {
      "/foo": "another/folder/path"
    }
  },
  "another.domain.com": {
    "paths": {
      "/": ["sphp", "path/to/sphp-project"]
    }
  },
  "php.domain.com": {
    "paths": {
      "/": ["php", "path/to/php-project"]
    }
  }
}
```

Finally, when you have completed editing the configuration file, run the `nginxify` command! That's all.

## Installation - Mac OS X

```bash
git clone <EMAIL>:NateFerrero/nginxify.git
cd nginxify
sudo make install-mac-os-x
```

Then to run on Mac OS X, just execute the following command: `sudo python /bin/nginxify && sudo nginx -s reload`.

For PHP, be sure to fix permissions for /var/run socket.

## Installation - Linux

```bash
git clone <EMAIL>:NateFerrero/nginxify.git
cd nginxify
sudo make install
```

Then, add the following to /etc/sudoers using `visudo`:

```bash
# Nginxify
%nginxify ALL=NOPASSWD: /bin/nginxify, /etc/init.d/nginx reload
```


## Allowing Users to run `nginxify`

```bash
sudo usermod -a -G nginxify the_username
```

Keep in mind that the user will have to open a new shell to gain the new group permissions.
<commit_msg>Cleanup readmoo<commit_after>nginxify
========

Nginxify parses JSON configurations of NGINX config files and creates the appropriate representations in configuration.

## Usage

Create a file called `.nginx` in your user home directory (/home/username), and populate according to the following JSON:

```js
{
  "my.domain.com": {
    "paths": {
      "/": "my_domain", // this is a directory relative to your home directory,
      "/testapp": 3000  // This will proxy all requests to a server running on port 3000
    }
  },
  "other.domain.com": {
    "paths": {
      "/foo": "another/folder/path"
    }
  },
  "another.domain.com": {
    "paths": {
      "/": ["sphp", "path/to/sphp-project"]
    }
  },
  "php.domain.com": {
    "paths": {
      "/": ["php", "path/to/php-project"]
    }
  }
}
```
#### Static

Static site path config has a string path relative to your home folder.

#### Proxy Pass

Proxy pass to a port with an integer port number as the path config.

#### PHP

PHP using [PHP-FPM](http://php-fpm.org/) is supported with the path config `["php", "path/to/project"]`.

#### SimplifiedPHP

[SimplifiedPHP](https://github.com/NateFerrero/simplified-php) using [PHP-FPM](http://php-fpm.org/) is supported with the path config `["sphp", "path/to/project"]`.

## Running Nginxify

Finally, when you have completed editing the configuration file, and after nginxify has been installed (see below), run the `nginxify` command! That's all.

## Installation - Mac OS X

```bash
git clone <EMAIL>:NateFerrero/nginxify.git
cd nginxify
sudo make install-mac-os-x
```

Then to run on Mac OS X, just execute the following command: `sudo python /bin/nginxify && sudo nginx -s reload`.

For PHP, be sure to fix permissions for /var/run socket.

## Installation - Linux

```bash
git clone <EMAIL>:NateFerrero/nginxify.git
cd nginxify
sudo make install
```

Then, add the following to /etc/sudoers using `visudo`:

```bash
# Nginxify
%nginxify ALL=NOPASSWD: /bin/nginxify, /etc/init.d/nginx reload
```


## Allowing Users to run `nginxify`

```bash
sudo usermod -a -G nginxify the_username
```

Keep in mind that the user will have to open a new shell to gain the new group permissions.

{'fraction_non_alphanumeric': 0.13910822108685555, 'fraction_numerical': 0.0037157454714352067, 'mean_word_length': 3.524159663865546, 'pattern_counts': {'":': 26, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4834723', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1389, 'n_words': 494}