refactored nginx script and spec